Skip to content

Commit 13e60c5

Browse files
committed
feat: Add commands to manage DBs in a cloud database service
Signed-off-by: Arthur Amstutz <arthur.amstutz@corp.ovh.com>
1 parent a969742 commit 13e60c5

15 files changed

+402
-57
lines changed

doc/ovhcloud_cloud.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Manage your projects and services in the Public Cloud universe
3030

3131
* [ovhcloud](ovhcloud.md) - CLI to manage your OVHcloud services
3232
* [ovhcloud cloud container-registry](ovhcloud_cloud_container-registry.md) - Manage container registries in the given cloud project
33-
* [ovhcloud cloud database](ovhcloud_cloud_database.md) - Manage databases in the given cloud project
33+
* [ovhcloud cloud database-service](ovhcloud_cloud_database-service.md) - Manage database services in the given cloud project
3434
* [ovhcloud cloud instance](ovhcloud_cloud_instance.md) - Manage instances in the given cloud project
3535
* [ovhcloud cloud kube](ovhcloud_cloud_kube.md) - Manage Kubernetes clusters in the given cloud project
3636
* [ovhcloud cloud loadbalancer](ovhcloud_cloud_loadbalancer.md) - Manage loadbalancers in the given cloud project
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
## ovhcloud cloud database
1+
## ovhcloud cloud database-service
22

3-
Manage databases in the given cloud project
3+
Manage database services in the given cloud project
44

55
### Options
66

77
```
88
--cloud-project string Cloud project ID
9-
-h, --help help for database
9+
-h, --help help for database-service
1010
```
1111

1212
### Options inherited from parent commands
@@ -30,9 +30,10 @@ Manage databases in the given cloud project
3030
### SEE ALSO
3131

3232
* [ovhcloud cloud](ovhcloud_cloud.md) - Manage your projects and services in the Public Cloud universe
33-
* [ovhcloud cloud database create](ovhcloud_cloud_database_create.md) - Create a new database
34-
* [ovhcloud cloud database delete](ovhcloud_cloud_database_delete.md) - Delete a specific database
35-
* [ovhcloud cloud database edit](ovhcloud_cloud_database_edit.md) - Edit a specific database
36-
* [ovhcloud cloud database get](ovhcloud_cloud_database_get.md) - Get a specific database
37-
* [ovhcloud cloud database list](ovhcloud_cloud_database_list.md) - List your databases
33+
* [ovhcloud cloud database-service create](ovhcloud_cloud_database-service_create.md) - Create a new database service
34+
* [ovhcloud cloud database-service database](ovhcloud_cloud_database-service_database.md) - Manage databases in a specific database service
35+
* [ovhcloud cloud database-service delete](ovhcloud_cloud_database-service_delete.md) - Delete a specific database service
36+
* [ovhcloud cloud database-service edit](ovhcloud_cloud_database-service_edit.md) - Edit a specific database service
37+
* [ovhcloud cloud database-service get](ovhcloud_cloud_database-service_get.md) - Get a specific database services
38+
* [ovhcloud cloud database-service list](ovhcloud_cloud_database-service_list.md) - List your database services
3839

doc/ovhcloud_cloud_database_create.md renamed to doc/ovhcloud_cloud_database-service_create.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
## ovhcloud cloud database create
1+
## ovhcloud cloud database-service create
22

3-
Create a new database
3+
Create a new database service
44

55
### Synopsis
66

7-
Use this command to create a database in the given public cloud project.
7+
Use this command to create a database service in the given public cloud project.
88
There are two ways to define the creation parameters:
99

1010
1. Using only CLI flags:
1111

12-
ovhcloud cloud database create --engine mysql --version 8 --plan essential --nodes-list "db1-4:DE"
12+
ovhcloud cloud database-service create --engine mysql --version 8 --plan essential --nodes-list "db1-4:DE"
1313

1414
2. Using your default text editor:
1515

16-
ovhcloud cloud database create --engine kafka --editor
16+
ovhcloud cloud database-service create --engine kafka --editor
1717

1818
You will be able to choose from several examples of parameters. Once an example has been selected, the CLI will open your
1919
default text editor to update the parameters. When saving the file, the creation will start.
2020

2121
Note that it is also possible to override values in the presented examples using command line flags like the following:
2222

23-
ovhcloud cloud database create --engine mysql --editor --version 8
23+
ovhcloud cloud database-service create --engine mysql --editor --version 8
2424

2525

2626
```
27-
ovhcloud cloud database create [flags]
27+
ovhcloud cloud database-service create [flags]
2828
```
2929

3030
### Options
@@ -73,5 +73,5 @@ ovhcloud cloud database create [flags]
7373

7474
### SEE ALSO
7575

76-
* [ovhcloud cloud database](ovhcloud_cloud_database.md) - Manage databases in the given cloud project
76+
* [ovhcloud cloud database-service](ovhcloud_cloud_database-service.md) - Manage database services in the given cloud project
7777

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## ovhcloud cloud database-service database
2+
3+
Manage databases in a specific database service
4+
5+
### Options
6+
7+
```
8+
-h, --help help for database
9+
```
10+
11+
### Options inherited from parent commands
12+
13+
```
14+
--cloud-project string Cloud project ID
15+
-d, --debug Activate debug mode (will log all HTTP requests details)
16+
-f, --format string Output value according to given format (expression using https://github.com/PaesslerAG/gval syntax)
17+
Examples:
18+
--format 'id' (to extract a single field)
19+
--format 'nested.field.subfield' (to extract a nested field)
20+
--format '[id, 'name']' (to extract multiple fields as an array)
21+
--format '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
22+
--format 'name+","+type' (to extract and concatenate fields in a string)
23+
--format '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
24+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
25+
-i, --interactive Interactive output
26+
-j, --json Output in JSON
27+
-y, --yaml Output in YAML
28+
```
29+
30+
### SEE ALSO
31+
32+
* [ovhcloud cloud database-service](ovhcloud_cloud_database-service.md) - Manage database services in the given cloud project
33+
* [ovhcloud cloud database-service database create](ovhcloud_cloud_database-service_database_create.md) - Create a new database in the given database service
34+
* [ovhcloud cloud database-service database delete](ovhcloud_cloud_database-service_database_delete.md) - Delete a specific database in the given database service
35+
* [ovhcloud cloud database-service database get](ovhcloud_cloud_database-service_database_get.md) - Get a specific database in the given database service
36+
* [ovhcloud cloud database-service database list](ovhcloud_cloud_database-service_database_list.md) - List all databases in the given database service
37+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## ovhcloud cloud database-service database create
2+
3+
Create a new database in the given database service
4+
5+
```
6+
ovhcloud cloud database-service database create <cluster_id> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
-h, --help help for create
13+
--name string Name of the database to create
14+
```
15+
16+
### Options inherited from parent commands
17+
18+
```
19+
--cloud-project string Cloud project ID
20+
-d, --debug Activate debug mode (will log all HTTP requests details)
21+
-f, --format string Output value according to given format (expression using https://github.com/PaesslerAG/gval syntax)
22+
Examples:
23+
--format 'id' (to extract a single field)
24+
--format 'nested.field.subfield' (to extract a nested field)
25+
--format '[id, 'name']' (to extract multiple fields as an array)
26+
--format '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
27+
--format 'name+","+type' (to extract and concatenate fields in a string)
28+
--format '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
29+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
30+
-i, --interactive Interactive output
31+
-j, --json Output in JSON
32+
-y, --yaml Output in YAML
33+
```
34+
35+
### SEE ALSO
36+
37+
* [ovhcloud cloud database-service database](ovhcloud_cloud_database-service_database.md) - Manage databases in a specific database service
38+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## ovhcloud cloud database-service database delete
2+
3+
Delete a specific database in the given database service
4+
5+
```
6+
ovhcloud cloud database-service database delete <cluster_id> <database_id> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
-h, --help help for delete
13+
```
14+
15+
### Options inherited from parent commands
16+
17+
```
18+
--cloud-project string Cloud project ID
19+
-d, --debug Activate debug mode (will log all HTTP requests details)
20+
-f, --format string Output value according to given format (expression using https://github.com/PaesslerAG/gval syntax)
21+
Examples:
22+
--format 'id' (to extract a single field)
23+
--format 'nested.field.subfield' (to extract a nested field)
24+
--format '[id, 'name']' (to extract multiple fields as an array)
25+
--format '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
26+
--format 'name+","+type' (to extract and concatenate fields in a string)
27+
--format '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
28+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
29+
-i, --interactive Interactive output
30+
-j, --json Output in JSON
31+
-y, --yaml Output in YAML
32+
```
33+
34+
### SEE ALSO
35+
36+
* [ovhcloud cloud database-service database](ovhcloud_cloud_database-service_database.md) - Manage databases in a specific database service
37+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## ovhcloud cloud database-service database get
2+
3+
Get a specific database in the given database service
4+
5+
```
6+
ovhcloud cloud database-service database get <cluster_id> <database_id> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
-h, --help help for get
13+
```
14+
15+
### Options inherited from parent commands
16+
17+
```
18+
--cloud-project string Cloud project ID
19+
-d, --debug Activate debug mode (will log all HTTP requests details)
20+
-f, --format string Output value according to given format (expression using https://github.com/PaesslerAG/gval syntax)
21+
Examples:
22+
--format 'id' (to extract a single field)
23+
--format 'nested.field.subfield' (to extract a nested field)
24+
--format '[id, 'name']' (to extract multiple fields as an array)
25+
--format '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
26+
--format 'name+","+type' (to extract and concatenate fields in a string)
27+
--format '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
28+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
29+
-i, --interactive Interactive output
30+
-j, --json Output in JSON
31+
-y, --yaml Output in YAML
32+
```
33+
34+
### SEE ALSO
35+
36+
* [ovhcloud cloud database-service database](ovhcloud_cloud_database-service_database.md) - Manage databases in a specific database service
37+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## ovhcloud cloud database-service database list
2+
3+
List all databases in the given database service
4+
5+
```
6+
ovhcloud cloud database-service database list <cluster_id> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
--filter stringArray Filter results by any property using https://github.com/PaesslerAG/gval syntax
13+
Examples:
14+
--filter 'state="running"'
15+
--filter 'name=~"^my.*"'
16+
--filter 'nested.property.subproperty>10'
17+
--filter 'startDate>="2023-12-01"'
18+
--filter 'name=~"something" && nbField>10'
19+
-h, --help help for list
20+
```
21+
22+
### Options inherited from parent commands
23+
24+
```
25+
--cloud-project string Cloud project ID
26+
-d, --debug Activate debug mode (will log all HTTP requests details)
27+
-f, --format string Output value according to given format (expression using https://github.com/PaesslerAG/gval syntax)
28+
Examples:
29+
--format 'id' (to extract a single field)
30+
--format 'nested.field.subfield' (to extract a nested field)
31+
--format '[id, 'name']' (to extract multiple fields as an array)
32+
--format '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
33+
--format 'name+","+type' (to extract and concatenate fields in a string)
34+
--format '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
35+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
36+
-i, --interactive Interactive output
37+
-j, --json Output in JSON
38+
-y, --yaml Output in YAML
39+
```
40+
41+
### SEE ALSO
42+
43+
* [ovhcloud cloud database-service database](ovhcloud_cloud_database-service_database.md) - Manage databases in a specific database service
44+

doc/ovhcloud_cloud_database_delete.md renamed to doc/ovhcloud_cloud_database-service_delete.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
## ovhcloud cloud database delete
1+
## ovhcloud cloud database-service delete
22

3-
Delete a specific database
3+
Delete a specific database service
44

55
```
6-
ovhcloud cloud database delete <database_id> [flags]
6+
ovhcloud cloud database-service delete <cluster_id> [flags]
77
```
88

99
### Options
@@ -33,5 +33,5 @@ ovhcloud cloud database delete <database_id> [flags]
3333

3434
### SEE ALSO
3535

36-
* [ovhcloud cloud database](ovhcloud_cloud_database.md) - Manage databases in the given cloud project
36+
* [ovhcloud cloud database-service](ovhcloud_cloud_database-service.md) - Manage database services in the given cloud project
3737

doc/ovhcloud_cloud_database_edit.md renamed to doc/ovhcloud_cloud_database-service_edit.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
## ovhcloud cloud database edit
1+
## ovhcloud cloud database-service edit
22

3-
Edit a specific database
3+
Edit a specific database service
44

55
### Synopsis
66

7-
Use this command to edit a database in the given public cloud project.
7+
Use this command to edit a database service in the given public cloud project.
88
There are two ways to define the edition parameters:
99

1010
1. Using only CLI flags:
1111

12-
ovhcloud cloud database edit <database_id> --description "My database"
12+
ovhcloud cloud database-service edit <cluster_id> --description "My database"
1313

1414
2. Using your default text editor:
1515

16-
ovhcloud cloud database edit <database_id> --editor
16+
ovhcloud cloud database-service edit <cluster_id> --editor
1717

1818
The CLI will open your default text editor to update the parameters. When saving the file, the edition will be applied.
1919

2020
Note that it is also possible to override values in the presented examples using command line flags like the following:
2121

22-
ovhcloud cloud database edit <database_id> --editor --description "My database"
22+
ovhcloud cloud database-service edit <cluster_id> --editor --description "My database cluster"
2323

2424

2525
```
26-
ovhcloud cloud database edit <database_id> [flags]
26+
ovhcloud cloud database-service edit <cluster_id> [flags]
2727
```
2828

2929
### Options
@@ -64,5 +64,5 @@ ovhcloud cloud database edit <database_id> [flags]
6464

6565
### SEE ALSO
6666

67-
* [ovhcloud cloud database](ovhcloud_cloud_database.md) - Manage databases in the given cloud project
67+
* [ovhcloud cloud database-service](ovhcloud_cloud_database-service.md) - Manage database services in the given cloud project
6868

0 commit comments

Comments
 (0)