Commit Graph

50 Commits (master)

Author SHA1 Message Date
Didier BONNEFOI 9aecbca3d4
Merge pull request #17 from bonidier/ovhapilib/add-put-data
ovhapilib bugfix: JSON datas must be set when PUT method is used
2018-09-26 19:47:04 +02:00
Didier BONNEFOI d71e06fb95 ovhapilib bugfix: JSON datas must be set when PUT method is used 2018-09-25 17:54:10 +02:00
Antoine Leveugle 8f94a4fa2c
Merge pull request #16 from bonidier/coding-style
Bash coding style review
2018-08-26 17:00:13 +02:00
Didier BONNEFOI e4aad34a4c fix: remove useless variable in updateTime() 2018-08-26 13:17:25 +02:00
Didier BONNEFOI 920bc41873 Bash coding style review
- functions: use lower case local variables
- set some configuration variables as constant
- review some variables naming
- test command: use built-in [[ instead of [
- always keep if+then in the same line
- change shebang for portability

Enhancements
- API headers: use OVH API's timestamp instead of user's one to bypass misconfigured host.
- simplify valid target check
- use API_URL when target is set
- help output rework
- refresh README
2018-08-26 13:08:27 +02:00
Didier BONNEFOI ec0e2e8a0b
Merge pull request #13 from denouche/build/enableTravis
build: add travis support for shellcheck
2018-08-13 10:56:13 +02:00
Didier BONNEFOI 5b2aed4ebc
Merge pull request #15 from denouche/feat/addUSApis
feat: add US target support
2018-08-01 23:25:46 +02:00
antoine.leveugle 43814562f5 feat: add US target support
closes #14
2018-08-01 16:23:21 +02:00
antoine.leveugle 99b2f49644 build: add travis support for shellcheck 2018-06-22 17:36:55 +02:00
Didier BONNEFOI 68c4fbe815
Merge pull request #12 from bonidier/shellcheck-pass
shellcheck pass + code review
2018-06-22 17:36:04 +02:00
Didier BONNEFOI fd6006cd14 shellcheck pass + code review:
- more readable long curl commands (multiple lines)
- add helpers to manage string's upper/lower case
- add helper to join array items
- fix functions's variables scope
2018-06-21 15:04:32 +02:00
Didier BONNEFOI 687060aa2b
Merge pull request #10 from bonidier/user_profile_path
move profiles to user home
2018-03-07 09:47:17 +01:00
Didier BONNEFOI c0eb83d771 fix default profile move to new location 2018-02-26 14:23:00 +01:00
Didier BONNEFOI 3cb29bc968 Automaticly move profiles from legacy path to user's home, and notify about it 2018-02-26 14:18:18 +01:00
Didier BONNEFOI b532476260 move profiles to user home 2018-02-20 17:12:34 +01:00
Antoine Leveugle a8df712a46
Merge pull request #9 from bonidier/script_realpath
fix BASE_PATH, resolving real path the script, to allow symlink this one
2018-02-20 13:32:36 +01:00
Didier BONNEFOI e47fb83ca0 fix BASE_PATH, resolving real path the script, to allow symlink this one 2018-02-20 12:15:36 +01:00
Antoine Leveugle ecc5fc988c
Merge pull request #7 from bonidier/access-rules
Add an access rules file into profile
2018-02-13 08:53:50 +01:00
Didier BONNEFOI 15f11e880f Add access.rules file into profile
- this feature avoid to write very long post data content when initiating consumer key
2018-02-12 18:07:45 +01:00
Antoine Leveugle e4f968c78a Merge pull request #5 from bonidier/ovhapi_lib
Ovhapi lib
2017-09-19 08:35:40 +02:00
Didier BONNEFOI ae35740057 OvhRequestApi() enhancements
- OVHAPI_HTTP_STATUS always return a numeric value
- raise error 500 with help message if OVHAPI_HTTP_RESPONSE has many lines
- update samples scripts with OvhRequestApi()
2017-07-19 11:45:54 +02:00
Didier BONNEFOI 8377493d0a JSON functions improvements
- single execution of JSON.sh, now read result from a cache
- JSON wrapper now use AWK for best performances, even on big JSON source
- remove JSON string argument from getJSON*() functions
- move JSON functions to a standalone file
- add JSONSHLIB_DEBUG variable
- add JSONSH_DIR to override JSON.sh path
- update samples scripts
- rework file tree
- update README
- update .gitignore
2017-07-14 01:09:28 +02:00
Didier BONNEFOI af4a56da66 OVH API Lib enhancements:
OvhRequestApi() review:
- ovh-api-bash-client.sh commandline piped to bash, for correct quotes management
- add target support with OVHAPI_TARGET variable

Wrappers for JSON.sh enhancements:
- JSON nested object managed, key displayed/set with a dot as separator.
- getJSONValues() support for object and nested object
- getJSONValue() hash support (getJSONString() removed)
- remove double quotes from field for getJSONKeys() and getJSONValue()
- getJSONArrayLength() removed, result can be calculated from getJSONValues() result

Lib debugging:
- add _ovhapilib_echo_debug() : redirect arguments to stderr
- add OVHAPILIB_DEBUG variable
2017-07-03 00:38:10 +02:00
Didier BONNEFOI f40fc3a025 add wrapper for using ovh-api-bash-client with external scripts 2017-06-30 18:57:05 +02:00
Antoine Leveugle 377f8930c3 doc: fix readme title 2017-06-21 14:47:55 +02:00
Antoine Leveugle 23231a9859 Merge pull request #4 from bonidier/configuration-profile
Allow multiple API keys management with profiles
2017-06-21 14:46:38 +02:00
Didier BONNEFOI 71c1d5fe6f profiles management enhancements
- when launching --init/--initApp, create the defined profile if missing
- fix profiles listing (bad directory)
- help command : always add --profile argument if profile name is defined
2017-06-21 14:31:13 +02:00
Didier BONNEFOI 143ad5114b Allow to set --profile option at any position :
- functions to create keys now launched out of parseArguments()

bugfix :
- fix empty CURRENT_PATH when launching --init/--initApp

enhancements :
- better output for --list-profile output + add 'default' profile

refactoring :
- move initApplication() into createConsumerKey() instead of calling it each time
2017-06-21 00:21:47 +02:00
Didier BONNEFOI 485cbd833e if --profile is set to 'default', load configuration from script directory 2017-06-19 18:36:33 +02:00
Didier BONNEFOI 1a0e3f220f Allow multiple API keys management with profiles
- add --profile to override default configuration location
- add --list-profile to display available profiles
- rework messages to display command with the current profile if set

Bugfix
- ensure OVH App Key an App Secret are defined when creating consumer key

Enhancements
- when using --init, allow override default "all permissions grants" if --data is set
- add -h/--help
2017-06-13 18:06:41 +02:00
antoine.leveugle 5719c46b2d feat: make the execution path relative 2016-06-09 20:53:21 +02:00
Antoine Leveugle 4ca8512f56 Merge pull request #3 from denouche/bash41
fix: assure compatibility with bash 4.0 and 4.1
2016-05-25 21:46:58 +02:00
antoine.leveugle fe3697eaaa fix: assure compatibility with bash 4.0 and 4.1
closes #2
2016-05-25 21:45:28 +02:00
antoine.leveugle 73c4e37107 update README 2014-04-29 22:37:11 +02:00
antoine.leveugle c3d7245a3b some little improvments 2014-04-29 00:25:57 +02:00
antoine.leveugle fcf5e6f588 add targets support for EU and CA apis 2014-04-28 23:14:33 +02:00
antoine.leveugle 1eb3c11c18 add check during initialization and information to create a consumer key later 2014-04-28 12:19:11 +02:00
antoine.leveugle c3c5130f5d add http response status in out, at the begining of the line 2014-04-27 15:12:56 +02:00
Antoine Leveugle 6a847aba20 Update README.md 2014-04-19 21:59:27 +02:00
antoine.leveugle 2f60538889 move script 2014-04-19 21:48:07 +02:00
Antoine Leveugle 1a044a7986 Update README.md 2014-04-17 22:17:44 +02:00
Antoine Leveugle ae3abbf4f3 Update README.md 2014-04-17 22:17:09 +02:00
antoine.leveugle 03514b89cd change base path to current path 2014-04-17 21:47:01 +02:00
Antoine Leveugle 0c1d719906 Update README.md 2014-04-17 21:31:01 +02:00
Antoine Leveugle 928178c732 Update README.md 2014-04-17 21:28:03 +02:00
Antoine Leveugle bff106c1fa Update README.md 2014-04-17 20:16:30 +02:00
Antoine Leveugle ca60dc6686 Create README.md 2014-04-17 20:13:09 +02:00
antoine.leveugle 01f8a1f689 improve help 2014-04-17 20:13:01 +02:00
antoine.leveugle d44ea3e138 move 2014-04-17 20:03:15 +02:00
antoine.leveugle 9c19977b67 first commit 2014-04-17 19:53:28 +02:00