Skip to content

Commit 476545e

Browse files
committed
feat: Allow defining multiple profiles in configuration
Signed-off-by: Arthur Amstutz <[email protected]>
1 parent d82b5f4 commit 476545e

File tree

616 files changed

+5383
-3667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

616 files changed

+5383
-3667
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ OVHcloud CLI requires authentication to be able to make API calls. There are sev
140140

141141
Check out the [authentication page](./doc/authentication.md) for further information about the configuration and the authentication means.
142142

143+
You can also manage multiple OVHcloud accounts using [profiles](./doc/profiles.md). Profiles let you store credentials for several accounts in a single configuration file and switch between them with `ovhcloud config profile switch <name>` or the `--profile` flag.
144+
143145
* Interactive login:
144146
```sh
145147
# Log in and create API credentials (interactive)

doc/ovhcloud.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ ohvcloud vps list -o json
2323

2424
Check out the [authentication page](authentication.md) for further information about the authentication means.
2525

26+
You can manage multiple OVHcloud accounts using [profiles](profiles.md). Create a profile with `ovhcloud login --profile <name>`, switch between them with `ovhcloud config profile switch <name>`, or use `--profile <name>` on any command.
27+
2628
### Generate Shell Completion
2729

2830
```bash

doc/ovhcloud_account.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ Manage your account
1111
### Options inherited from parent commands
1212

1313
```
14-
-d, --debug Activate debug mode (will log all HTTP requests details)
15-
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
16-
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
17-
Examples:
18-
--output json
19-
--output yaml
20-
--output interactive
21-
--output 'id' (to extract a single field)
22-
--output 'nested.field.subfield' (to extract a nested field)
23-
--output '[id, "name"]' (to extract multiple fields as an array)
24-
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
25-
--output 'name+","+type' (to extract and concatenate fields in a string)
26-
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
14+
-d, --debug Activate debug mode (will log all HTTP requests details)
15+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
16+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
17+
Examples:
18+
--output json
19+
--output yaml
20+
--output interactive
21+
--output 'id' (to extract a single field)
22+
--output 'nested.field.subfield' (to extract a nested field)
23+
--output '[id, "name"]' (to extract multiple fields as an array)
24+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
25+
--output 'name+","+type' (to extract and concatenate fields in a string)
26+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
27+
--profile string Use a specific profile from the configuration file
2728
```
2829

2930
### SEE ALSO

doc/ovhcloud_account_api.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ Manage your API credentials
1111
### Options inherited from parent commands
1212

1313
```
14-
-d, --debug Activate debug mode (will log all HTTP requests details)
15-
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
16-
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
17-
Examples:
18-
--output json
19-
--output yaml
20-
--output interactive
21-
--output 'id' (to extract a single field)
22-
--output 'nested.field.subfield' (to extract a nested field)
23-
--output '[id, "name"]' (to extract multiple fields as an array)
24-
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
25-
--output 'name+","+type' (to extract and concatenate fields in a string)
26-
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
14+
-d, --debug Activate debug mode (will log all HTTP requests details)
15+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
16+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
17+
Examples:
18+
--output json
19+
--output yaml
20+
--output interactive
21+
--output 'id' (to extract a single field)
22+
--output 'nested.field.subfield' (to extract a nested field)
23+
--output '[id, "name"]' (to extract multiple fields as an array)
24+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
25+
--output 'name+","+type' (to extract and concatenate fields in a string)
26+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
27+
--profile string Use a specific profile from the configuration file
2728
```
2829

2930
### SEE ALSO

doc/ovhcloud_account_api_oauth2.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ Manage your OAuth2 clients
1111
### Options inherited from parent commands
1212

1313
```
14-
-d, --debug Activate debug mode (will log all HTTP requests details)
15-
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
16-
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
17-
Examples:
18-
--output json
19-
--output yaml
20-
--output interactive
21-
--output 'id' (to extract a single field)
22-
--output 'nested.field.subfield' (to extract a nested field)
23-
--output '[id, "name"]' (to extract multiple fields as an array)
24-
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
25-
--output 'name+","+type' (to extract and concatenate fields in a string)
26-
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
14+
-d, --debug Activate debug mode (will log all HTTP requests details)
15+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
16+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
17+
Examples:
18+
--output json
19+
--output yaml
20+
--output interactive
21+
--output 'id' (to extract a single field)
22+
--output 'nested.field.subfield' (to extract a nested field)
23+
--output '[id, "name"]' (to extract multiple fields as an array)
24+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
25+
--output 'name+","+type' (to extract and concatenate fields in a string)
26+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
27+
--profile string Use a specific profile from the configuration file
2728
```
2829

2930
### SEE ALSO

doc/ovhcloud_account_api_oauth2_client.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ Manage your OAuth2 clients
1111
### Options inherited from parent commands
1212

1313
```
14-
-d, --debug Activate debug mode (will log all HTTP requests details)
15-
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
16-
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
17-
Examples:
18-
--output json
19-
--output yaml
20-
--output interactive
21-
--output 'id' (to extract a single field)
22-
--output 'nested.field.subfield' (to extract a nested field)
23-
--output '[id, "name"]' (to extract multiple fields as an array)
24-
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
25-
--output 'name+","+type' (to extract and concatenate fields in a string)
26-
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
14+
-d, --debug Activate debug mode (will log all HTTP requests details)
15+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
16+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
17+
Examples:
18+
--output json
19+
--output yaml
20+
--output interactive
21+
--output 'id' (to extract a single field)
22+
--output 'nested.field.subfield' (to extract a nested field)
23+
--output '[id, "name"]' (to extract multiple fields as an array)
24+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
25+
--output 'name+","+type' (to extract and concatenate fields in a string)
26+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
27+
--profile string Use a specific profile from the configuration file
2728
```
2829

2930
### SEE ALSO

doc/ovhcloud_account_api_oauth2_client_create.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,20 @@ ovhcloud account api oauth2 client create [flags]
2323
### Options inherited from parent commands
2424

2525
```
26-
-d, --debug Activate debug mode (will log all HTTP requests details)
27-
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
28-
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
29-
Examples:
30-
--output json
31-
--output yaml
32-
--output interactive
33-
--output 'id' (to extract a single field)
34-
--output 'nested.field.subfield' (to extract a nested field)
35-
--output '[id, "name"]' (to extract multiple fields as an array)
36-
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
37-
--output 'name+","+type' (to extract and concatenate fields in a string)
38-
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
26+
-d, --debug Activate debug mode (will log all HTTP requests details)
27+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
28+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
29+
Examples:
30+
--output json
31+
--output yaml
32+
--output interactive
33+
--output 'id' (to extract a single field)
34+
--output 'nested.field.subfield' (to extract a nested field)
35+
--output '[id, "name"]' (to extract multiple fields as an array)
36+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
37+
--output 'name+","+type' (to extract and concatenate fields in a string)
38+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
39+
--profile string Use a specific profile from the configuration file
3940
```
4041

4142
### SEE ALSO

doc/ovhcloud_account_api_oauth2_client_delete.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@ ovhcloud account api oauth2 client delete <client_id> [flags]
1515
### Options inherited from parent commands
1616

1717
```
18-
-d, --debug Activate debug mode (will log all HTTP requests details)
19-
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
20-
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
21-
Examples:
22-
--output json
23-
--output yaml
24-
--output interactive
25-
--output 'id' (to extract a single field)
26-
--output 'nested.field.subfield' (to extract a nested field)
27-
--output '[id, "name"]' (to extract multiple fields as an array)
28-
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
29-
--output 'name+","+type' (to extract and concatenate fields in a string)
30-
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
18+
-d, --debug Activate debug mode (will log all HTTP requests details)
19+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
20+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
21+
Examples:
22+
--output json
23+
--output yaml
24+
--output interactive
25+
--output 'id' (to extract a single field)
26+
--output 'nested.field.subfield' (to extract a nested field)
27+
--output '[id, "name"]' (to extract multiple fields as an array)
28+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
29+
--output 'name+","+type' (to extract and concatenate fields in a string)
30+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
31+
--profile string Use a specific profile from the configuration file
3132
```
3233

3334
### SEE ALSO

doc/ovhcloud_account_api_oauth2_client_edit.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,20 @@ ovhcloud account api oauth2 client edit <client_id> [flags]
1919
### Options inherited from parent commands
2020

2121
```
22-
-d, --debug Activate debug mode (will log all HTTP requests details)
23-
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
24-
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
25-
Examples:
26-
--output json
27-
--output yaml
28-
--output interactive
29-
--output 'id' (to extract a single field)
30-
--output 'nested.field.subfield' (to extract a nested field)
31-
--output '[id, "name"]' (to extract multiple fields as an array)
32-
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
33-
--output 'name+","+type' (to extract and concatenate fields in a string)
34-
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
22+
-d, --debug Activate debug mode (will log all HTTP requests details)
23+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
24+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
25+
Examples:
26+
--output json
27+
--output yaml
28+
--output interactive
29+
--output 'id' (to extract a single field)
30+
--output 'nested.field.subfield' (to extract a nested field)
31+
--output '[id, "name"]' (to extract multiple fields as an array)
32+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
33+
--output 'name+","+type' (to extract and concatenate fields in a string)
34+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
35+
--profile string Use a specific profile from the configuration file
3536
```
3637

3738
### SEE ALSO

doc/ovhcloud_account_api_oauth2_client_get.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@ ovhcloud account api oauth2 client get <client_id> [flags]
1515
### Options inherited from parent commands
1616

1717
```
18-
-d, --debug Activate debug mode (will log all HTTP requests details)
19-
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
20-
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
21-
Examples:
22-
--output json
23-
--output yaml
24-
--output interactive
25-
--output 'id' (to extract a single field)
26-
--output 'nested.field.subfield' (to extract a nested field)
27-
--output '[id, "name"]' (to extract multiple fields as an array)
28-
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
29-
--output 'name+","+type' (to extract and concatenate fields in a string)
30-
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
18+
-d, --debug Activate debug mode (will log all HTTP requests details)
19+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
20+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
21+
Examples:
22+
--output json
23+
--output yaml
24+
--output interactive
25+
--output 'id' (to extract a single field)
26+
--output 'nested.field.subfield' (to extract a nested field)
27+
--output '[id, "name"]' (to extract multiple fields as an array)
28+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
29+
--output 'name+","+type' (to extract and concatenate fields in a string)
30+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
31+
--profile string Use a specific profile from the configuration file
3132
```
3233

3334
### SEE ALSO

0 commit comments

Comments
 (0)