From 4530284e4ce49175834afda91205c4d8bf3f7030 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Fri, 23 Sep 2022 13:15:09 +0200 Subject: [PATCH 01/29] GaussDB for NoSQL --- openstack/gaussdbnosql/v3/ListDatastores.go | 1 + openstack/gaussdbnosql/v3/ListFlavors.go | 1 + openstack/gaussdbnosql/v3/ListSlowLogs.go | 1 + openstack/gaussdbnosql/v3/apiversion/ListApiVersion.go | 1 + openstack/gaussdbnosql/v3/apiversion/ShowApiVersion.go | 1 + openstack/gaussdbnosql/v3/backup/SetBackupPolicy.go | 1 + openstack/gaussdbnosql/v3/backup/ShowBackupPolicy.go | 1 + openstack/gaussdbnosql/v3/instance/CreateInstance.go | 1 + openstack/gaussdbnosql/v3/instance/DeleteInstance.go | 1 + openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go | 1 + openstack/gaussdbnosql/v3/instance/ListInstances.go | 1 + openstack/gaussdbnosql/v3/instance/ResetPassword.go | 1 + openstack/gaussdbnosql/v3/instance/ResizeInstance.go | 1 + openstack/gaussdbnosql/v3/instance/ResizeInstanceVolume.go | 1 + openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go | 1 + openstack/gaussdbnosql/v3/instance/UpdateInstanceName.go | 1 + openstack/gaussdbnosql/v3/parameter/ApplyConfiguration.go | 1 + openstack/gaussdbnosql/v3/parameter/CreateConfiguration.go | 1 + openstack/gaussdbnosql/v3/parameter/DeleteConfiguration.go | 1 + openstack/gaussdbnosql/v3/parameter/ListConfigurations.go | 1 + openstack/gaussdbnosql/v3/parameter/ShowConfigurationDetail.go | 1 + openstack/gaussdbnosql/v3/parameter/ShowInstanceConfiguration.go | 1 + openstack/gaussdbnosql/v3/parameter/UpdateConfiguration.go | 1 + .../gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go | 1 + openstack/gaussdbnosql/v3/tag/BatchTagAction.go | 1 + openstack/gaussdbnosql/v3/tag/ListInstanceTags.go | 1 + openstack/gaussdbnosql/v3/tag/ListInstancesByResourceTags.go | 1 + 27 files changed, 27 insertions(+) create mode 100644 openstack/gaussdbnosql/v3/ListDatastores.go create mode 100644 openstack/gaussdbnosql/v3/ListFlavors.go create mode 100644 openstack/gaussdbnosql/v3/ListSlowLogs.go create mode 100644 openstack/gaussdbnosql/v3/apiversion/ListApiVersion.go create mode 100644 openstack/gaussdbnosql/v3/apiversion/ShowApiVersion.go create mode 100644 openstack/gaussdbnosql/v3/backup/SetBackupPolicy.go create mode 100644 openstack/gaussdbnosql/v3/backup/ShowBackupPolicy.go create mode 100644 openstack/gaussdbnosql/v3/instance/CreateInstance.go create mode 100644 openstack/gaussdbnosql/v3/instance/DeleteInstance.go create mode 100644 openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go create mode 100644 openstack/gaussdbnosql/v3/instance/ListInstances.go create mode 100644 openstack/gaussdbnosql/v3/instance/ResetPassword.go create mode 100644 openstack/gaussdbnosql/v3/instance/ResizeInstance.go create mode 100644 openstack/gaussdbnosql/v3/instance/ResizeInstanceVolume.go create mode 100644 openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go create mode 100644 openstack/gaussdbnosql/v3/instance/UpdateInstanceName.go create mode 100644 openstack/gaussdbnosql/v3/parameter/ApplyConfiguration.go create mode 100644 openstack/gaussdbnosql/v3/parameter/CreateConfiguration.go create mode 100644 openstack/gaussdbnosql/v3/parameter/DeleteConfiguration.go create mode 100644 openstack/gaussdbnosql/v3/parameter/ListConfigurations.go create mode 100644 openstack/gaussdbnosql/v3/parameter/ShowConfigurationDetail.go create mode 100644 openstack/gaussdbnosql/v3/parameter/ShowInstanceConfiguration.go create mode 100644 openstack/gaussdbnosql/v3/parameter/UpdateConfiguration.go create mode 100644 openstack/gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go create mode 100644 openstack/gaussdbnosql/v3/tag/BatchTagAction.go create mode 100644 openstack/gaussdbnosql/v3/tag/ListInstanceTags.go create mode 100644 openstack/gaussdbnosql/v3/tag/ListInstancesByResourceTags.go diff --git a/openstack/gaussdbnosql/v3/ListDatastores.go b/openstack/gaussdbnosql/v3/ListDatastores.go new file mode 100644 index 000000000..eac3ae96a --- /dev/null +++ b/openstack/gaussdbnosql/v3/ListDatastores.go @@ -0,0 +1 @@ +package v3 diff --git a/openstack/gaussdbnosql/v3/ListFlavors.go b/openstack/gaussdbnosql/v3/ListFlavors.go new file mode 100644 index 000000000..eac3ae96a --- /dev/null +++ b/openstack/gaussdbnosql/v3/ListFlavors.go @@ -0,0 +1 @@ +package v3 diff --git a/openstack/gaussdbnosql/v3/ListSlowLogs.go b/openstack/gaussdbnosql/v3/ListSlowLogs.go new file mode 100644 index 000000000..eac3ae96a --- /dev/null +++ b/openstack/gaussdbnosql/v3/ListSlowLogs.go @@ -0,0 +1 @@ +package v3 diff --git a/openstack/gaussdbnosql/v3/apiversion/ListApiVersion.go b/openstack/gaussdbnosql/v3/apiversion/ListApiVersion.go new file mode 100644 index 000000000..2f7894f13 --- /dev/null +++ b/openstack/gaussdbnosql/v3/apiversion/ListApiVersion.go @@ -0,0 +1 @@ +package apiversion diff --git a/openstack/gaussdbnosql/v3/apiversion/ShowApiVersion.go b/openstack/gaussdbnosql/v3/apiversion/ShowApiVersion.go new file mode 100644 index 000000000..2f7894f13 --- /dev/null +++ b/openstack/gaussdbnosql/v3/apiversion/ShowApiVersion.go @@ -0,0 +1 @@ +package apiversion diff --git a/openstack/gaussdbnosql/v3/backup/SetBackupPolicy.go b/openstack/gaussdbnosql/v3/backup/SetBackupPolicy.go new file mode 100644 index 000000000..0d44d4781 --- /dev/null +++ b/openstack/gaussdbnosql/v3/backup/SetBackupPolicy.go @@ -0,0 +1 @@ +package backup diff --git a/openstack/gaussdbnosql/v3/backup/ShowBackupPolicy.go b/openstack/gaussdbnosql/v3/backup/ShowBackupPolicy.go new file mode 100644 index 000000000..0d44d4781 --- /dev/null +++ b/openstack/gaussdbnosql/v3/backup/ShowBackupPolicy.go @@ -0,0 +1 @@ +package backup diff --git a/openstack/gaussdbnosql/v3/instance/CreateInstance.go b/openstack/gaussdbnosql/v3/instance/CreateInstance.go new file mode 100644 index 000000000..1807170a8 --- /dev/null +++ b/openstack/gaussdbnosql/v3/instance/CreateInstance.go @@ -0,0 +1 @@ +package instance diff --git a/openstack/gaussdbnosql/v3/instance/DeleteInstance.go b/openstack/gaussdbnosql/v3/instance/DeleteInstance.go new file mode 100644 index 000000000..1807170a8 --- /dev/null +++ b/openstack/gaussdbnosql/v3/instance/DeleteInstance.go @@ -0,0 +1 @@ +package instance diff --git a/openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go b/openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go new file mode 100644 index 000000000..1807170a8 --- /dev/null +++ b/openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go @@ -0,0 +1 @@ +package instance diff --git a/openstack/gaussdbnosql/v3/instance/ListInstances.go b/openstack/gaussdbnosql/v3/instance/ListInstances.go new file mode 100644 index 000000000..1807170a8 --- /dev/null +++ b/openstack/gaussdbnosql/v3/instance/ListInstances.go @@ -0,0 +1 @@ +package instance diff --git a/openstack/gaussdbnosql/v3/instance/ResetPassword.go b/openstack/gaussdbnosql/v3/instance/ResetPassword.go new file mode 100644 index 000000000..1807170a8 --- /dev/null +++ b/openstack/gaussdbnosql/v3/instance/ResetPassword.go @@ -0,0 +1 @@ +package instance diff --git a/openstack/gaussdbnosql/v3/instance/ResizeInstance.go b/openstack/gaussdbnosql/v3/instance/ResizeInstance.go new file mode 100644 index 000000000..1807170a8 --- /dev/null +++ b/openstack/gaussdbnosql/v3/instance/ResizeInstance.go @@ -0,0 +1 @@ +package instance diff --git a/openstack/gaussdbnosql/v3/instance/ResizeInstanceVolume.go b/openstack/gaussdbnosql/v3/instance/ResizeInstanceVolume.go new file mode 100644 index 000000000..1807170a8 --- /dev/null +++ b/openstack/gaussdbnosql/v3/instance/ResizeInstanceVolume.go @@ -0,0 +1 @@ +package instance diff --git a/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go b/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go new file mode 100644 index 000000000..1807170a8 --- /dev/null +++ b/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go @@ -0,0 +1 @@ +package instance diff --git a/openstack/gaussdbnosql/v3/instance/UpdateInstanceName.go b/openstack/gaussdbnosql/v3/instance/UpdateInstanceName.go new file mode 100644 index 000000000..1807170a8 --- /dev/null +++ b/openstack/gaussdbnosql/v3/instance/UpdateInstanceName.go @@ -0,0 +1 @@ +package instance diff --git a/openstack/gaussdbnosql/v3/parameter/ApplyConfiguration.go b/openstack/gaussdbnosql/v3/parameter/ApplyConfiguration.go new file mode 100644 index 000000000..31350f1cf --- /dev/null +++ b/openstack/gaussdbnosql/v3/parameter/ApplyConfiguration.go @@ -0,0 +1 @@ +package parameter diff --git a/openstack/gaussdbnosql/v3/parameter/CreateConfiguration.go b/openstack/gaussdbnosql/v3/parameter/CreateConfiguration.go new file mode 100644 index 000000000..31350f1cf --- /dev/null +++ b/openstack/gaussdbnosql/v3/parameter/CreateConfiguration.go @@ -0,0 +1 @@ +package parameter diff --git a/openstack/gaussdbnosql/v3/parameter/DeleteConfiguration.go b/openstack/gaussdbnosql/v3/parameter/DeleteConfiguration.go new file mode 100644 index 000000000..31350f1cf --- /dev/null +++ b/openstack/gaussdbnosql/v3/parameter/DeleteConfiguration.go @@ -0,0 +1 @@ +package parameter diff --git a/openstack/gaussdbnosql/v3/parameter/ListConfigurations.go b/openstack/gaussdbnosql/v3/parameter/ListConfigurations.go new file mode 100644 index 000000000..31350f1cf --- /dev/null +++ b/openstack/gaussdbnosql/v3/parameter/ListConfigurations.go @@ -0,0 +1 @@ +package parameter diff --git a/openstack/gaussdbnosql/v3/parameter/ShowConfigurationDetail.go b/openstack/gaussdbnosql/v3/parameter/ShowConfigurationDetail.go new file mode 100644 index 000000000..31350f1cf --- /dev/null +++ b/openstack/gaussdbnosql/v3/parameter/ShowConfigurationDetail.go @@ -0,0 +1 @@ +package parameter diff --git a/openstack/gaussdbnosql/v3/parameter/ShowInstanceConfiguration.go b/openstack/gaussdbnosql/v3/parameter/ShowInstanceConfiguration.go new file mode 100644 index 000000000..31350f1cf --- /dev/null +++ b/openstack/gaussdbnosql/v3/parameter/ShowInstanceConfiguration.go @@ -0,0 +1 @@ +package parameter diff --git a/openstack/gaussdbnosql/v3/parameter/UpdateConfiguration.go b/openstack/gaussdbnosql/v3/parameter/UpdateConfiguration.go new file mode 100644 index 000000000..31350f1cf --- /dev/null +++ b/openstack/gaussdbnosql/v3/parameter/UpdateConfiguration.go @@ -0,0 +1 @@ +package parameter diff --git a/openstack/gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go b/openstack/gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go new file mode 100644 index 000000000..31350f1cf --- /dev/null +++ b/openstack/gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go @@ -0,0 +1 @@ +package parameter diff --git a/openstack/gaussdbnosql/v3/tag/BatchTagAction.go b/openstack/gaussdbnosql/v3/tag/BatchTagAction.go new file mode 100644 index 000000000..686c0dfff --- /dev/null +++ b/openstack/gaussdbnosql/v3/tag/BatchTagAction.go @@ -0,0 +1 @@ +package tag diff --git a/openstack/gaussdbnosql/v3/tag/ListInstanceTags.go b/openstack/gaussdbnosql/v3/tag/ListInstanceTags.go new file mode 100644 index 000000000..686c0dfff --- /dev/null +++ b/openstack/gaussdbnosql/v3/tag/ListInstanceTags.go @@ -0,0 +1 @@ +package tag diff --git a/openstack/gaussdbnosql/v3/tag/ListInstancesByResourceTags.go b/openstack/gaussdbnosql/v3/tag/ListInstancesByResourceTags.go new file mode 100644 index 000000000..686c0dfff --- /dev/null +++ b/openstack/gaussdbnosql/v3/tag/ListInstancesByResourceTags.go @@ -0,0 +1 @@ +package tag From 23a637167d6af40c1671a26caf07b42ae1ec2c86 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Tue, 27 Sep 2022 17:50:41 +0200 Subject: [PATCH 02/29] ListDatastores --- openstack/gaussdbnosql/v3/ListDatastores.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/openstack/gaussdbnosql/v3/ListDatastores.go b/openstack/gaussdbnosql/v3/ListDatastores.go index eac3ae96a..d661b729a 100644 --- a/openstack/gaussdbnosql/v3/ListDatastores.go +++ b/openstack/gaussdbnosql/v3/ListDatastores.go @@ -1 +1,18 @@ package v3 + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +func ListDatastores(client *golangsdk.ServiceClient, datastoreName string) ([]string, error) { + // GET https://{Endpoint}/v3/{project_id}/datastores/{datastore_name}/versions + raw, err := client.Get(client.ServiceURL("datastores", datastoreName, "versions"), nil, nil) + if err != nil { + return nil, err + } + + var res []string + err = extract.IntoSlicePtr(raw.Body, &res, "versions") + return res, err +} From 993cea7ba032d7561933bb4a293f346b760853e6 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Tue, 27 Sep 2022 18:00:17 +0200 Subject: [PATCH 03/29] ListFlavors --- openstack/gaussdbnosql/v3/ListFlavors.go | 66 ++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/openstack/gaussdbnosql/v3/ListFlavors.go b/openstack/gaussdbnosql/v3/ListFlavors.go index eac3ae96a..d01c13151 100644 --- a/openstack/gaussdbnosql/v3/ListFlavors.go +++ b/openstack/gaussdbnosql/v3/ListFlavors.go @@ -1 +1,67 @@ package v3 + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +type ListFlavorsOpts struct { + // Region where the instance is deployed. + // Valid value: + // The value cannot be empty. For details about how to obtain this parameter value, see Regions and Endpoints. + Region string `json:"region"` + // engine_name No Database type + //  If the value is cassandra, the GaussDB(for Cassandra) DB instance specifications are queried, + //  If this parameter is not transferred, the default value is cassandra. + EngineName string `json:"engine_name,omitempty"` +} + +func ListFlavors(client *golangsdk.ServiceClient, opts ListFlavorsOpts) ([]string, error) { + q, err := golangsdk.BuildQueryString(opts) + if err != nil { + return nil, err + } + + // GET https://{Endpoint}/v3/{project_id}/flavors + raw, err := client.Get(client.ServiceURL("flavors")+q.String(), nil, nil) + if err != nil { + return nil, err + } + + var res []string + err = extract.IntoSlicePtr(raw.Body, &res, "versions") + return res, err +} + +type ListFlavorsResponse struct { + // Total number of records + TotalCount int32 `json:"total_count"` + // Instance specifications. + Flavors []ListFlavorsResult `json:"flavors"` +} + +type ListFlavorsResult struct { + // Engine name + EngineName string `json:"engine_name"` + // Engine version + EngineVersion string `json:"engine_version"` + // Number of vCPUs + Vcpus string `json:"vcpus"` + // Memory size in megabytes (MB) + Ram string `json:"ram"` + // Resource specification code + // Example: geminidb.cassandra.8xlarge.4 + // NOTE + //  geminidb.cassandra indicates GaussDB(for Cassandra). + //  8xlarge.4 indicates the single-node specifications. + SpecCode string `json:"spec_code"` + // ID of the AZ that supports this specification + // NOTE + //  This field is discarded and cannot be used. + AvailabilityZone []string `json:"availability_zone"` + // Status of specifications in an AZ. The value can be: + //  normal: indicates that the specifications are on sale. + //  unsupported: not supported. + //  sellout: indicates that the instance specifications are sold out. + AzStatus *interface{} `json:"az_status"` +} From 2ad3649aaede6c9582128ea1ff9ee8015aa3b314 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Tue, 27 Sep 2022 18:08:47 +0200 Subject: [PATCH 04/29] ListSlowLogs --- openstack/gaussdbnosql/v3/ListFlavors.go | 12 ++--- openstack/gaussdbnosql/v3/ListSlowLogs.go | 62 +++++++++++++++++++++++ 2 files changed, 68 insertions(+), 6 deletions(-) diff --git a/openstack/gaussdbnosql/v3/ListFlavors.go b/openstack/gaussdbnosql/v3/ListFlavors.go index d01c13151..91a9cc082 100644 --- a/openstack/gaussdbnosql/v3/ListFlavors.go +++ b/openstack/gaussdbnosql/v3/ListFlavors.go @@ -9,14 +9,14 @@ type ListFlavorsOpts struct { // Region where the instance is deployed. // Valid value: // The value cannot be empty. For details about how to obtain this parameter value, see Regions and Endpoints. - Region string `json:"region"` + Region string `q:"region"` // engine_name No Database type //  If the value is cassandra, the GaussDB(for Cassandra) DB instance specifications are queried, //  If this parameter is not transferred, the default value is cassandra. - EngineName string `json:"engine_name,omitempty"` + EngineName string `q:"engine_name,omitempty"` } -func ListFlavors(client *golangsdk.ServiceClient, opts ListFlavorsOpts) ([]string, error) { +func ListFlavors(client *golangsdk.ServiceClient, opts ListFlavorsOpts) (*ListFlavorsResponse, error) { q, err := golangsdk.BuildQueryString(opts) if err != nil { return nil, err @@ -28,9 +28,9 @@ func ListFlavors(client *golangsdk.ServiceClient, opts ListFlavorsOpts) ([]strin return nil, err } - var res []string - err = extract.IntoSlicePtr(raw.Body, &res, "versions") - return res, err + var res ListFlavorsResponse + err = extract.Into(raw.Body, &res) + return &res, err } type ListFlavorsResponse struct { diff --git a/openstack/gaussdbnosql/v3/ListSlowLogs.go b/openstack/gaussdbnosql/v3/ListSlowLogs.go index eac3ae96a..08138465b 100644 --- a/openstack/gaussdbnosql/v3/ListSlowLogs.go +++ b/openstack/gaussdbnosql/v3/ListSlowLogs.go @@ -1 +1,63 @@ package v3 + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +type ListSlowLogsOpts struct { + // Instance ID + InstanceId string `q:"instance_id"` + // Start time in the "yyyy-mm-ddThh:mm:ssZ" format. + StartDate string `q:"start_date"` + // End time in the "yyyy-mm-ddThh:mm:ssZ" format. + EndDate string `q:"end_date"` + // Node ID. If this parameter is left blank, all nodes of the instance are queried. + NodeId string `q:"node_id,omitempty"` + // Statement type. If this parameter is left empty, all statement types are queried. + // You can also specify the following log type: + //  SELECT + Type string `q:"type,omitempty"` + // Index offset. Its value range is [0, 1999]. + // If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, + // indicating that the query starts from the first piece of data. The value must be a positive number. + Offset int32 `q:"offset,omitempty"` + // Number of records to be queried. The value ranges from 1 (inclusive) to 100 (inclusive). + // The sum of values of limit and offset must be less than or equal to 2000. + Limit int32 `q:"limit,omitempty"` +} + +func ListSlowLogs(client *golangsdk.ServiceClient, opts ListSlowLogsOpts) (*ListSlowLogsResponse, error) { + q, err := golangsdk.BuildQueryString(opts) + if err != nil { + return nil, err + } + + // GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/slowlog + raw, err := client.Get(client.ServiceURL("instances")+q.String(), nil, nil) + if err != nil { + return nil, err + } + + var res ListSlowLogsResponse + err = extract.Into(raw.Body, &res) + return &res, err +} + +type ListSlowLogsResponse struct { + SlowLogList []SlowlogResult `json:"slow_log_listq"` + TotalRecord int32 `json:"total_recordq"` +} + +type SlowlogResult struct { + // Execution time + Time string `json:"time"` + // Database which slow logs belong to + Database string `json:"database"` + // Execution syntax + QuerySample string `json:"query_sample"` + // Statement type + Type string `json:"type"` + // Time in the UTC format + StartTime string `json:"start_time"` +} From f69952e107bdd6e4fbc448faae2f56ac854bbeeb Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Tue, 27 Sep 2022 18:27:38 +0200 Subject: [PATCH 05/29] CreateInstance --- openstack/gaussdbnosql/v3/ListFlavors.go | 2 +- .../v3/instance/CreateInstance.go | 142 ++++++++++++++++++ 2 files changed, 143 insertions(+), 1 deletion(-) diff --git a/openstack/gaussdbnosql/v3/ListFlavors.go b/openstack/gaussdbnosql/v3/ListFlavors.go index 91a9cc082..3d0a96d79 100644 --- a/openstack/gaussdbnosql/v3/ListFlavors.go +++ b/openstack/gaussdbnosql/v3/ListFlavors.go @@ -63,5 +63,5 @@ type ListFlavorsResult struct { //  normal: indicates that the specifications are on sale. //  unsupported: not supported. //  sellout: indicates that the instance specifications are sold out. - AzStatus *interface{} `json:"az_status"` + AzStatus string `json:"az_status"` } diff --git a/openstack/gaussdbnosql/v3/instance/CreateInstance.go b/openstack/gaussdbnosql/v3/instance/CreateInstance.go index 1807170a8..bd89b18e6 100644 --- a/openstack/gaussdbnosql/v3/instance/CreateInstance.go +++ b/openstack/gaussdbnosql/v3/instance/CreateInstance.go @@ -1 +1,143 @@ package instance + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +type CreateInstanceOpts struct { + // Instance name, which can be the same as an existing instance name. + // Value range: + // The value must be 4 to 64 characters in length and start with a letter (from A to Z or from a to z). + // It is case-sensitive and can contain only letters, digits (from 0 to 9), hyphens (-), and underscores (_). + Name string `json:"name"` + // Database information. + Datastore Datastore `json:"datastore"` + // Region ID + // The value cannot be empty. + Region string `json:"region"` + // AZ ID + // For details about the value, see az_status returned in 5.3 Querying All Instance Specifications. + // Separate multiple AZs by commas (,). + AvailabilityZone string `json:"availability_zone"` + // VPC ID. To obtain this parameter value, use either of the following methods: + //  Method 1: Log in to VPC console and view the VPC ID on the VPC details page. + //  Method 2: See the "Querying VPCs" section in the Virtual Private Cloud API Reference. + VpcId string `json:"vpc_id"` + // Network ID of the subnet. To obtain this parameter value, use either of the following methods: + //  Method 1: Log in to VPC console and click the target subnet on the Subnets page. You can view the subnet ID on the displayed page. + //  Method 2: See the "Querying Subnets" section in the Virtual Private Cloud API Reference. + SubnetId string `json:"subnet_id"` + // Security group ID. To obtain the security group ID, perform either of the following methods: + //  Method 1: Log in to VPC console. Choose Access Control > Security Groups in the navigation pane on the left. + // On the displayed page, click the target security group. You can view the security group ID on the displayed page. + //  Method 2: See the "Querying Security Groups" section in the Virtual Private Cloud API Reference. + SecurityGroupId string `json:"security_group_id"` + // Database password + // The value must be 8 to 32 characters in length and contain uppercase letters (A to Z), + // lowercase letters (a to z), digits (0 to 9), and special characters, such as ~!@#%^*-_=+? + // You are advised to enter a strong password to improve security, preventing security risks such as brute force cracking. + Password string `json:"password"` + // Instance type + //  GaussDB(for Cassandra) supports the cluster type. The value is "Cluster". + Mode string `json:"mode"` + // Instance specifications + Flavor []InstanceFlavor `json:"flavor"` + // Parameter template ID + ConfigurationId string `json:"configuration_id,omitempty"` + // Advanced backup policy. + BackupStrategy BackupStrategy `json:"backup_strategy,omitempty"` + // Specifies whether to enable or disable SSL. + // Valid value: + //  The value "0" indicates that SSL is disabled by default. + //  The value "1" indicates that SSL is enabled by default. + //  If this parameter is not transferred, SSL is disabled by default. + SslOption string `json:"ssl_option,omitempty"` +} + +func CreateInstance(client *golangsdk.ServiceClient, opts CreateInstanceOpts) (*CreateInstanceResponse, error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return nil, err + } + + // POST https://{Endpoint}/v3/{project_id}/instances + raw, err := client.Post(client.ServiceURL("instances"), b, nil, nil) + if err != nil { + return nil, err + } + + var res CreateInstanceResponse + err = extract.Into(raw.Body, &res) + return &res, err +} + +type CreateInstanceResponse struct { + // Instance ID + Id string `json:"id"` + // Database information, which is the same as the request parameter. + Datastore Datastore `json:"datastore"` + // Instance name, which is the same as the request parameter. + Name string `json:"name"` + // Creation time, which is in the yyyy-mm-dd hh:mm:ss format. + Created string `json:"created"` + // Instance status. The value is creating. + Status string `json:"status"` + // Region ID, which is the same as the request parameter. + Region string `json:"region"` + // AZ ID, which is the same as the request parameter. + AvailabilityZone string `json:"availability_zone"` + // VPC ID, which is the same as the request parameter. + VpcId string `json:"vpc_id"` + // Network ID of the subnet, which is the same as the request parameter. + SubnetId string `json:"subnet_id"` + // Security group ID, which is the same as the request parameter. + SecurityGroupId string `json:"security_group_id"` + // Instance type, which is the same as the request parameter. + Mode string `json:"mode"` + // Instance specification, which is the same as the request parameter. + Flavor []InstanceFlavor `json:"flavor"` + // Advanced backup policy, which is the same as the request parameter. + BackupStrategy BackupStrategy `json:"backup_strategy"` + // Indicates whether to enable SSL, which functions the same as the request parameter. + SslOption string `json:"ssl_option"` + // ID of the job for creating an instance. + JobId string `json:"job_id"` +} + +type Datastore struct { + // Database type + // GaussDB(for Cassandra) instances are supported. + // The value "cassandra" indicates that a GaussDB(for Cassandra) DB instance is created. + Type string `json:"type"` + // Database version + // The value "3.11" indicates that the GaussDB(for Cassandra) 3.11 is supported. + Version string `json:"version"` + // Storage engine + // The value "rocksDB" indicates that the GaussDB(for Cassandra) instance supports the RocksDB storage engine. + StorageEngine string `json:"storage_engine"` +} + +type InstanceFlavor struct { + // Node quantity + //  The number of GaussDB(for Cassandra) instance nodes ranges from 3 to 200. + Num string `json:"num"` + // Disk type + // Valid value: ULTRAHIGH, which indicates the SSD disk. + Storage string `json:"storage"` + // Storage space. The value must be an integer, in GB. + Size string `json:"size"` + // Resource specification code + SpecCode string `json:"spec_code"` +} + +type BackupStrategy struct { + // Backup time window Automated backups will be triggered during the backup time window. + // The value cannot be empty. It must be a valid value in the "hh:mm-HH:MM" format. + // The current time is in the UTC format. + StartTime string `json:"start_time"` + // Number of days to retain the generated backup files. + // Value range: 0-35. + KeepDays string `json:"keep_days,omitempty"` +} From a0a8f1dd5d792db39040b680f9f992b464b0410e Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 12:41:13 +0200 Subject: [PATCH 06/29] Delete --- .../v3/instance/DeleteInstance.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/openstack/gaussdbnosql/v3/instance/DeleteInstance.go b/openstack/gaussdbnosql/v3/instance/DeleteInstance.go index 1807170a8..9dc2b2f0b 100644 --- a/openstack/gaussdbnosql/v3/instance/DeleteInstance.go +++ b/openstack/gaussdbnosql/v3/instance/DeleteInstance.go @@ -1 +1,20 @@ package instance + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +func Delete(client *golangsdk.ServiceClient, instanceId string) (string, error) { + // DELETE https://{Endpoint}/v3/{project_id}/instances/{instance_id} + raw, err := client.Delete(client.ServiceURL("instances", instanceId), nil) + if err != nil { + return "", err + } + + var res struct { + JobId string `json:"job_id"` + } + err = extract.Into(raw.Body, &res) + return res.JobId, err +} From 77dfbe64dc22a978cc0dd9c5b9cc65aea6c3796c Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 12:55:19 +0200 Subject: [PATCH 07/29] ListInstances --- .../v3/instance/DeleteInstance.go | 2 +- .../gaussdbnosql/v3/instance/ListInstances.go | 167 ++++++++++++++++++ 2 files changed, 168 insertions(+), 1 deletion(-) diff --git a/openstack/gaussdbnosql/v3/instance/DeleteInstance.go b/openstack/gaussdbnosql/v3/instance/DeleteInstance.go index 9dc2b2f0b..b1dac0b75 100644 --- a/openstack/gaussdbnosql/v3/instance/DeleteInstance.go +++ b/openstack/gaussdbnosql/v3/instance/DeleteInstance.go @@ -5,7 +5,7 @@ import ( "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" ) -func Delete(client *golangsdk.ServiceClient, instanceId string) (string, error) { +func DeleteInstance(client *golangsdk.ServiceClient, instanceId string) (string, error) { // DELETE https://{Endpoint}/v3/{project_id}/instances/{instance_id} raw, err := client.Delete(client.ServiceURL("instances", instanceId), nil) if err != nil { diff --git a/openstack/gaussdbnosql/v3/instance/ListInstances.go b/openstack/gaussdbnosql/v3/instance/ListInstances.go index 1807170a8..9ab550792 100644 --- a/openstack/gaussdbnosql/v3/instance/ListInstances.go +++ b/openstack/gaussdbnosql/v3/instance/ListInstances.go @@ -1 +1,168 @@ package instance + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +type ListInstancesOpts struct { + // Instance ID + // If you use asterisk (*) at the beginning of the id, fuzzy search results are returned. + // Otherwise, the exact results are returned. + Id string `q:"id,omitempty"` + // Instance name + // If you use asterisk (*) at the beginning of the name, fuzzy search results are returned. + // Otherwise, the exact results are returned. + Name string `q:"name,omitempty"` + // Instance type + // Cluster indicates the GaussDB(for Cassandra) cluster instance. + // If the datastore_type parameter is not transferred, this parameter is automatically ignored. + Mode string `q:"mode,omitempty"` + // Database type + // If the value is cassandra, GaussDB(for Cassandra) DB instances are queried. + // If this parameter is not transferred, all DB instances are queried. + DatastoreType string `q:"datastore_type,omitempty"` + // VPC ID. To obtain this parameter value, use either of the following methods: + //  Method 1: Log in to VPC console and view the VPC ID on the VPC details page. + //  Method 2: See the "Querying VPCs" section in the Virtual Private Cloud API Reference. + VpcId string `q:"vpc_id,omitempty"` + // Network ID of the subnet. To obtain this parameter value, use either of the following methods: + //  Method 1: Log in to VPC console and click the target subnet on the Subnets page. You can view the subnet ID on the displayed page. + //  Method 2: See the "Querying Subnets" section in the Virtual Private Cloud API Reference. + SubnetId string `q:"subnet_id,omitempty"` + // Index position. The query starts from the next instance creation time indexed by this parameter under a specified project. + // If offset is set to N, the resource query starts from the N+1 piece of data + // The value must be greater than or equal to 0. If this parameter is not transferred, + // offset is set to 0 by default, indicating that the query starts from the latest created instance. + Offset int32 `q:"offset,omitempty"` + // The maximum allowed number of instances. + // The value ranges from 1 to 100. If this parameter is not transferred, the first 100 instances are queried by default. + Limit int32 `q:"limit,omitempty"` +} + +func ListInstances(client *golangsdk.ServiceClient, opts ListInstancesOpts) (*ListInstancesResponse, error) { + q, err := golangsdk.BuildQueryString(opts) + if err != nil { + return nil, err + } + + // GET https://{Endpoint}/v3/{project_id}/instances + raw, err := client.Get(client.ServiceURL("instances")+q.String(), nil, nil) + if err != nil { + return nil, err + } + + var res ListInstancesResponse + err = extract.Into(raw.Body, &res) + return &res, err +} + +type ListInstancesResponse struct { + Instances []ListInstancesResult `json:"instances"` + TotalCount int32 `json:"total_count"` +} + +type ListInstancesResult struct { + // Instance ID + Id string `json:"id"` + // Instance name + Name string `json:"name"` + // Instance status + // Valid value: + //  normal: indicates that the instance is running properly. + //  abnormal: indicates that the instance is abnormal. + //  creating: indicates that the instance is being created. + //  data_disk_full: indicates that the instance disk is full. + //  createfail: indicates that the instance failed to be created. + //  enlargefail: indicates that nodes failed to be added to the instance. + Status string `json:"status"` + // Database port + Port string `json:"port"` + // Instance type, which is the same as the request parameter. + Mode string `json:"mode"` + // Region where the instance is deployed. + Region string `json:"region"` + // Database information. + Datastore InstancesDatastore `json:"datastore"` + // Storage engine + // The value is "rocksDB". + Engine string `json:"engine"` + // Instance creation time + Created string `json:"created"` + // The time when an instance is updated. + Updated string `json:"updated"` + // Default username. The value is rwuser. + DbUserName string `json:"db_user_name"` + // VPC ID + VpcId string `json:"vpc_id"` + // Subnet ID + SubnetId string `json:"subnet_id"` + // Security group ID + SecurityGroupId string `json:"security_group_id"` + // Backup policy. + BackupStrategy InstancesBackupStrategy `json:"backup_strategy"` + // The value is set to "0". + PayMode string `json:"pay_mode"` + // Maintenance time window + MaintenanceWindow string `json:"maintenance_window"` + // Group information. + Groups []InstancesGroup `json:"groups"` + // Time zone + TimeZone string `json:"time_zone"` + // The operation that is executed on the instance. + Actions []string `json:"actions"` +} + +type InstancesDatastore struct { + // Database type + Type string `json:"type"` + // Database version + Version string `json:"version"` +} + +type InstancesBackupStrategy struct { + // Backup time window. Automated backups will be triggered during the backup time window. The current time is the UTC time. + StartTime string `json:"start_time"` + // Backup retention days. Value range: 0-35. + KeepDays int32 `json:"keep_days"` +} + +type InstancesGroup struct { + // Group ID + Id string `json:"id"` + // Group status + Status string `json:"status"` + // Volume information. + Volume Volume `json:"volume"` + // Node information + Nodes []InstancesNode `json:"nodes"` +} + +type Volume struct { + // Storage space. Unit: GB + Size string `json:"size"` + // Storage space usage. Unit: GB + Used string `json:"used"` +} + +type InstancesNode struct { + // Node ID + Id string `json:"id"` + // Node name + Name string `json:"name"` + // Node status + Status string `json:"status"` + // Private IP address of a node. This parameter value exists after the ECS is created. Otherwise, the value is "". + PrivateIp string `json:"private_ip"` + // Bound EIP. This parameter is valid only for nodes bound with EIPs. + PublicIp string `json:"public_ip"` + // Resource specification code + // For details, see the value of the flavors.spec_code parameter in 5.3 Querying All Instance Specifications. + SpecCode string `json:"spec_code"` + // AvailabilityZone + AvailabilityZone string `json:"availability_zone"` + // Whether scaling in instances is supported. + // true: indicates that the node scale-in is supported. + // false: indicates that the node scale-in is not supported. + SupportReduce bool `json:"support_reduce"` +} From 51647d66dfaea960727f3d9f6676a9e1ebd7e8a9 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 12:59:52 +0200 Subject: [PATCH 08/29] ResizeInstanceVolume --- .../v3/instance/DeleteInstance.go | 6 +++++ .../v3/instance/ResizeInstanceVolume.go | 23 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/openstack/gaussdbnosql/v3/instance/DeleteInstance.go b/openstack/gaussdbnosql/v3/instance/DeleteInstance.go index b1dac0b75..082626e82 100644 --- a/openstack/gaussdbnosql/v3/instance/DeleteInstance.go +++ b/openstack/gaussdbnosql/v3/instance/DeleteInstance.go @@ -1,6 +1,8 @@ package instance import ( + "net/http" + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" ) @@ -8,6 +10,10 @@ import ( func DeleteInstance(client *golangsdk.ServiceClient, instanceId string) (string, error) { // DELETE https://{Endpoint}/v3/{project_id}/instances/{instance_id} raw, err := client.Delete(client.ServiceURL("instances", instanceId), nil) + return extraJob(err, raw) +} + +func extraJob(err error, raw *http.Response) (string, error) { if err != nil { return "", err } diff --git a/openstack/gaussdbnosql/v3/instance/ResizeInstanceVolume.go b/openstack/gaussdbnosql/v3/instance/ResizeInstanceVolume.go index 1807170a8..7a777311b 100644 --- a/openstack/gaussdbnosql/v3/instance/ResizeInstanceVolume.go +++ b/openstack/gaussdbnosql/v3/instance/ResizeInstanceVolume.go @@ -1 +1,24 @@ package instance + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" +) + +type ResizeInstanceVolumeOpts struct { + InstanceId string + // The requested disk capacity. The value must be an integer greater than the current disk capacity. + // The maximum disk capacity depends on the engine type and specifications. + Size int32 `json:"size"` +} + +func ResizeInstanceVolume(client *golangsdk.ServiceClient, opts ResizeInstanceVolumeOpts) (string, error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return "", err + } + + // POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/extend-volume + raw, err := client.Post(client.ServiceURL("instances", opts.InstanceId, "extend-volume"), b, nil, nil) + return extraJob(err, raw) +} From 9148476bd93e87df79547ce33b369449616e7851 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 13:02:38 +0200 Subject: [PATCH 09/29] ExpandInstanceNode --- .../v3/instance/ExpandInstanceNode.go | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go b/openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go index 1807170a8..cfa245d6e 100644 --- a/openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go +++ b/openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go @@ -1 +1,23 @@ package instance + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" +) + +type ExpandInstanceNodeRequest struct { + InstanceId string + // Number of new nodes + Num int32 `json:"num"` +} + +func ExpandInstanceNode(client *golangsdk.ServiceClient, opts ResizeInstanceVolumeOpts) (string, error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return "", err + } + + // POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/enlarge-node + raw, err := client.Post(client.ServiceURL("instances", opts.InstanceId, "enlarge-node"), b, nil, nil) + return extraJob(err, raw) +} From 0c5f68f54e6eff6d5c635116b43b009b77210243 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 13:05:45 +0200 Subject: [PATCH 10/29] ShrinkInstanceNode --- .../v3/instance/ExpandInstanceNode.go | 4 +-- .../v3/instance/ShrinkInstanceNode.go | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go b/openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go index cfa245d6e..cf2307524 100644 --- a/openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go +++ b/openstack/gaussdbnosql/v3/instance/ExpandInstanceNode.go @@ -5,13 +5,13 @@ import ( "github.com/opentelekomcloud/gophertelekomcloud/internal/build" ) -type ExpandInstanceNodeRequest struct { +type ExpandInstanceNodeOpts struct { InstanceId string // Number of new nodes Num int32 `json:"num"` } -func ExpandInstanceNode(client *golangsdk.ServiceClient, opts ResizeInstanceVolumeOpts) (string, error) { +func ExpandInstanceNode(client *golangsdk.ServiceClient, opts ExpandInstanceNodeOpts) (string, error) { b, err := build.RequestBody(opts, "") if err != nil { return "", err diff --git a/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go b/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go index 1807170a8..cc08e64e9 100644 --- a/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go +++ b/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go @@ -1 +1,36 @@ package instance + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" +) + +type ShrinkInstanceNodeOpts struct { + InstanceId string + // The number of nodes that are reduced randomly. + // The value is 1. + // NOTE + // If the client is directly connected to a node, you are not advised to delete nodes randomly. + Num int32 `json:"num,omitempty"` + // The ID of the node to be deleted. The node must support scale-in. If this parameter is not transferred, the number of nodes to be deleted is specified based on the internal policy of the system. + // NOTE + //  Either num or node_list must be set. + //  If num is transferred, the value must be 1. + //  If node_list is transferred, the value must be 1. + //  If the values of num and node_list are transferred at the same time, the value of node_list is used. + //  If the value of node_list is empty, scale-in is performed on random nodes. + // If the value of node_list is not empty, the scale-in is performed based on the specified node ID. + //  Before scale-in, do not directly connect a node to prevent service interruption caused by scale-in. + NodeList []string `json:"node_list,omitempty"` +} + +func ShrinkInstanceNode(client *golangsdk.ServiceClient, opts ExpandInstanceNodeOpts) (string, error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return "", err + } + + // POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/reduce-node + raw, err := client.Post(client.ServiceURL("instances", opts.InstanceId, "reduce-node"), b, nil, nil) + return extraJob(err, raw) +} From 34d5bff9fa9af197e4aa4aa2efa05f9df985952c Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 13:08:38 +0200 Subject: [PATCH 11/29] ResizeInstance --- .../v3/instance/ResizeInstance.go | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openstack/gaussdbnosql/v3/instance/ResizeInstance.go b/openstack/gaussdbnosql/v3/instance/ResizeInstance.go index 1807170a8..6933afa4c 100644 --- a/openstack/gaussdbnosql/v3/instance/ResizeInstance.go +++ b/openstack/gaussdbnosql/v3/instance/ResizeInstance.go @@ -1 +1,27 @@ package instance + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" +) + +type ResizeInstanceOpts struct { + InstanceId string + Resize ResizeInstanceOption `json:"resize"` +} + +type ResizeInstanceOption struct { + // Resource specification code of the new specification + TargetSpecCode string `json:"target_spec_code"` +} + +func ResizeInstance(client *golangsdk.ServiceClient, opts ExpandInstanceNodeOpts) (string, error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return "", err + } + + // PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/resize + raw, err := client.Put(client.ServiceURL("instances", opts.InstanceId, "resize"), b, nil, nil) + return extraJob(err, raw) +} From 15f5060f8e80061bbf452ca6789e284e79bf8346 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 13:10:42 +0200 Subject: [PATCH 12/29] ResetPassword --- .../gaussdbnosql/v3/instance/ResetPassword.go | 25 +++++++++++++++++++ .../v3/instance/ResizeInstance.go | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/openstack/gaussdbnosql/v3/instance/ResetPassword.go b/openstack/gaussdbnosql/v3/instance/ResetPassword.go index 1807170a8..b0ca6b0fc 100644 --- a/openstack/gaussdbnosql/v3/instance/ResetPassword.go +++ b/openstack/gaussdbnosql/v3/instance/ResetPassword.go @@ -1 +1,26 @@ package instance + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" +) + +type ResetPasswordOpts struct { + InstanceId string + // Database password + // The value must be 8 to 32 characters in length and contain uppercase letters (A to Z), + // lowercase letters (a to z), digits (0 to 9), and special characters, such as ~!@#%^*-_=+? + // You are advised to enter a strong password to improve security, preventing security risks such as brute force cracking. + Password string `json:"password"` +} + +func ResetPassword(client *golangsdk.ServiceClient, opts ResetPasswordOpts) (err error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return + } + + // PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/password + _, err = client.Put(client.ServiceURL("instances", opts.InstanceId, "password"), b, nil, nil) + return +} diff --git a/openstack/gaussdbnosql/v3/instance/ResizeInstance.go b/openstack/gaussdbnosql/v3/instance/ResizeInstance.go index 6933afa4c..bc0304fcd 100644 --- a/openstack/gaussdbnosql/v3/instance/ResizeInstance.go +++ b/openstack/gaussdbnosql/v3/instance/ResizeInstance.go @@ -15,7 +15,7 @@ type ResizeInstanceOption struct { TargetSpecCode string `json:"target_spec_code"` } -func ResizeInstance(client *golangsdk.ServiceClient, opts ExpandInstanceNodeOpts) (string, error) { +func ResizeInstance(client *golangsdk.ServiceClient, opts ResizeInstanceOpts) (string, error) { b, err := build.RequestBody(opts, "") if err != nil { return "", err From f531967759684597c894da472127dec9efe4cb12 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 13:13:59 +0200 Subject: [PATCH 13/29] UpdateInstanceName --- .../v3/instance/ShrinkInstanceNode.go | 2 +- .../v3/instance/UpdateInstanceName.go | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go b/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go index cc08e64e9..ec1e8e148 100644 --- a/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go +++ b/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go @@ -24,7 +24,7 @@ type ShrinkInstanceNodeOpts struct { NodeList []string `json:"node_list,omitempty"` } -func ShrinkInstanceNode(client *golangsdk.ServiceClient, opts ExpandInstanceNodeOpts) (string, error) { +func ShrinkInstanceNode(client *golangsdk.ServiceClient, opts ShrinkInstanceNodeOpts) (string, error) { b, err := build.RequestBody(opts, "") if err != nil { return "", err diff --git a/openstack/gaussdbnosql/v3/instance/UpdateInstanceName.go b/openstack/gaussdbnosql/v3/instance/UpdateInstanceName.go index 1807170a8..463b3bded 100644 --- a/openstack/gaussdbnosql/v3/instance/UpdateInstanceName.go +++ b/openstack/gaussdbnosql/v3/instance/UpdateInstanceName.go @@ -1 +1,26 @@ package instance + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" +) + +type UpdateInstanceNameOpts struct { + InstanceId string + // New instance name + // Value range: + // The value must be 4 to 64 characters in length and start with a letter (from A to Z or from a to z). + // It is case-sensitive and can contain only letters, digits (from 0 to 9), hyphens (-), and underscores (_). + Name string `json:"name"` +} + +func UpdateInstanceName(client *golangsdk.ServiceClient, opts UpdateInstanceNameOpts) (err error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return + } + + // PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/name + _, err = client.Put(client.ServiceURL("instances", opts.InstanceId, "name"), b, nil, nil) + return +} From 27d414c5476f521d151693f25820ae39a4a3779d Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 13:25:56 +0200 Subject: [PATCH 14/29] ShowBackupPolicy --- .../v3/backup/ShowBackupPolicy.go | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openstack/gaussdbnosql/v3/backup/ShowBackupPolicy.go b/openstack/gaussdbnosql/v3/backup/ShowBackupPolicy.go index 0d44d4781..d3fddb732 100644 --- a/openstack/gaussdbnosql/v3/backup/ShowBackupPolicy.go +++ b/openstack/gaussdbnosql/v3/backup/ShowBackupPolicy.go @@ -1 +1,27 @@ package backup + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +func ShowBackupPolicy(client *golangsdk.ServiceClient, instanceId string) (*ShowBackupPolicyResult, error) { + // GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/backups/policy + raw, err := client.Get(client.ServiceURL("instances", instanceId, "backups", "policy"), nil, nil) + if err != nil { + return nil, err + } + + var res ShowBackupPolicyResult + err = extract.IntoStructPtr(raw.Body, &res, "backup_policy") + return &res, err +} + +type ShowBackupPolicyResult struct { + // Backup retention days + KeepDays int32 `json:"keep_days"` + // Backup time window. Automated backups will be triggered during the backup time window. + StartTime string `json:"start_time"` + // Backup cycle configuration. Data will be automatically backed up on the selected days every week. + Period string `json:"period"` +} From caf99a19912b9545ceb71de7aacb2bae318978cd Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 16:03:38 +0200 Subject: [PATCH 15/29] SetBackupPolicy --- .../gaussdbnosql/v3/backup/SetBackupPolicy.go | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/openstack/gaussdbnosql/v3/backup/SetBackupPolicy.go b/openstack/gaussdbnosql/v3/backup/SetBackupPolicy.go index 0d44d4781..6ac41e2f5 100644 --- a/openstack/gaussdbnosql/v3/backup/SetBackupPolicy.go +++ b/openstack/gaussdbnosql/v3/backup/SetBackupPolicy.go @@ -1 +1,46 @@ package backup + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" +) + +type SetBackupPolicyOpts struct { + InstanceId string + // Backup policy object, which includes the backup retention period (days) and start time. + BackupPolicy BackupPolicy `json:"backup_policy"` +} + +type BackupPolicy struct { + // Backup retention days. Value range: 0-35. The value 0 indicates that the automated backup policy is disabled. + KeepDays int32 `json:"keep_days"` + // Backup time window. Automated backups will be triggered during the backup time window. + // This parameter is mandatory if the automated backup policy is enabled. + // This parameter is not transferred if the automated backup policy is disabled. + // The value must be a valid value in the "hh:mm-HH:MM" format. The current time is in the UTC format. + // The HH value must be 1 greater than the hh value. + // The values of mm and MM must be the same and must be set to any of the following: 00, 15, 30, and 45. + // If this parameter is not transferred, the default backup time window is from 00:00 to 01:00. + // Example value: 23:00-00:00 + StartTime string `json:"start_time,omitempty"` + // Backup cycle configuration. Data will be automatically backed up on the selected days every week. + // Value range: The value is a number separated by DBS case commas (,). The number indicates the week. + // The restrictions on the backup retention period are as follows: + // This parameter is not transferred if its value is set to 0. + // If you set the retention period to 1 to 6 days, data is automatically backed up each day of the week. + // Set the parameter value to 1,2,3,4,5,6,7. + // If you set the retention period to 7 to 732 days, select at least one day of the week for the backup cycle. + // Example value: 1,2,3,4 + Period string `json:"period,omitempty"` +} + +func SetBackupPolicy(client *golangsdk.ServiceClient, opts SetBackupPolicyOpts) (err error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return + } + + // PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/backups/policy + _, err = client.Put(client.ServiceURL("instances", opts.InstanceId, "backups", "policy"), b, nil, nil) + return +} From f621060bc9ddea73ce346a3aff58e197b4c26dc3 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 16:31:02 +0200 Subject: [PATCH 16/29] ListConfigurationsResponse --- .../v3/parameter/ListConfigurations.go | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/openstack/gaussdbnosql/v3/parameter/ListConfigurations.go b/openstack/gaussdbnosql/v3/parameter/ListConfigurations.go index 31350f1cf..bbf3e1049 100644 --- a/openstack/gaussdbnosql/v3/parameter/ListConfigurations.go +++ b/openstack/gaussdbnosql/v3/parameter/ListConfigurations.go @@ -1 +1,46 @@ package parameter + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +func ListConfigurations(client *golangsdk.ServiceClient) (*ListConfigurationsResponse, error) { + // GET https://{Endpoint}/v3/{project_id}/configurations + raw, err := client.Get(client.ServiceURL("configurations"), nil, nil) + if err != nil { + return nil, err + } + + var res ListConfigurationsResponse + err = extract.Into(raw.Body, &res) + return &res, err +} + +type ListConfigurationsResponse struct { + // Total number of queried records + Count int32 `json:"count,omitempty"` + // Parameter templates + Configurations []ListConfigurationsResult `json:"configurations,omitempty"` +} + +type ListConfigurationsResult struct { + // Parameter template ID + Id string `json:"id"` + // Parameter template name + Name string `json:"name"` + // Parameter template description + Description *string `json:"description,omitempty"` + // DB version name + DatastoreVersionName string `json:"datastore_version_name"` + // Database name + DatastoreName string `json:"datastore_name"` + // Creation time in the "yyyy-MM-ddTHH:mm:ssZ" format. + Created string `json:"created"` + // Update time in the "yyyy-MM-ddTHH:mm:ssZ" format. + Updated string `json:"updated"` + // Whether the parameter template is a custom template. + // false: The parameter template is a default parameter template. + // true: The parameter template is a custom template. + UserDefined bool `json:"user_defined"` +} From 123123cfaedb41f6f7a547facacc7fdf92cfc6b5 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 16:43:22 +0200 Subject: [PATCH 17/29] CreateInstance --- .../v3/parameter/CreateConfiguration.go | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/openstack/gaussdbnosql/v3/parameter/CreateConfiguration.go b/openstack/gaussdbnosql/v3/parameter/CreateConfiguration.go index 31350f1cf..dd9b42b0c 100644 --- a/openstack/gaussdbnosql/v3/parameter/CreateConfiguration.go +++ b/openstack/gaussdbnosql/v3/parameter/CreateConfiguration.go @@ -1 +1,62 @@ package parameter + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +type CreateConfigurationOpts struct { + // Parameter template name. It contains a maximum of 64 characters and can contain only uppercase letters, + // lowercase letters, digits, hyphens (-), underscores (_), and periods (.). + Name string `json:"name"` + // Parameter template description. It contains a maximum of 256 characters except the following special characters: + // >!<"&'= The value is left blank by default. + Description string `json:"description,omitempty"` + // Database object. + Datastore ConfigurationDatastore `json:"datastore"` + // The parameter values defined by users based on the default parameter template. + // By default, the parameter values cannot be changed. + Values map[string]string `json:"values,omitempty"` +} + +type ConfigurationDatastore struct { + // Database type. For GaussDB(for Cassandra), the value is "cassandra". + Type string `json:"type"` + // Database version The value 3.11 indicates that GaussDB(for Cassandra) 3.11 is supported. + Version string `json:"version"` +} + +func CreateInstance(client *golangsdk.ServiceClient, opts CreateConfigurationOpts) (*CreateConfigurationResult, error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return nil, err + } + + // POST https://{Endpoint}/v3/{project_id}/configurations + raw, err := client.Post(client.ServiceURL("configurations"), b, nil, nil) + if err != nil { + return nil, err + } + + var res CreateConfigurationResult + err = extract.IntoStructPtr(raw.Body, &res, "configuration") + return &res, err +} + +type CreateConfigurationResult struct { + // Parameter template ID + Id string `json:"id"` + // Parameter template name + Name string `json:"name"` + // Parameter template description. + Description string `json:"description,omitempty"` + // DB version name + DatastoreVersionName string `json:"datastore_version_name"` + // Database name + DatastoreName string `json:"datastore_name"` + // Creation time in the "yyyy-MM-ddTHH:mm:ssZ" format. + Created string `json:"created"` + // Update time in the "yyyy-MM-ddTHH:mm:ssZ" format. + Updated string `json:"updated"` +} From a5e43c6d2ca37f1d569cd8dca8b0cc756d9b1845 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 16:48:43 +0200 Subject: [PATCH 18/29] UpdateConfiguration --- .../v3/parameter/UpdateConfiguration.go | 30 +++++++++++++++++++ .../parameter/UpdateInstanceConfiguration.go | 16 ++++++++++ 2 files changed, 46 insertions(+) diff --git a/openstack/gaussdbnosql/v3/parameter/UpdateConfiguration.go b/openstack/gaussdbnosql/v3/parameter/UpdateConfiguration.go index 31350f1cf..6c841df5f 100644 --- a/openstack/gaussdbnosql/v3/parameter/UpdateConfiguration.go +++ b/openstack/gaussdbnosql/v3/parameter/UpdateConfiguration.go @@ -1 +1,31 @@ package parameter + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" +) + +type UpdateConfigurationOpts struct { + // Parameter template ID + ConfigId string `json:"config_id"` + // Parameter template name. It contains a maximum of 64 characters and can contain only uppercase letters, + // lowercase letters, digits, hyphens (-), underscores (_), and periods (.). + Name string `json:"name,omitempty"` + // Parameter template description. It contains a maximum of 256 characters except the following special characters: + // >!<"&'= The value is left blank by default. + Description string `json:"description,omitempty"` + // The parameter values defined by users based on the default parameter template. + // If the value is empty, the parameter value is not changed. + Values map[string]string `json:"values,omitempty"` +} + +func UpdateConfiguration(client *golangsdk.ServiceClient, opts UpdateConfigurationOpts) (err error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return + } + + // PUT https://{Endpoint}/v3/{project_id}/configurations/{config_id} + _, err = client.Put(client.ServiceURL("configurations", opts.ConfigId), b, nil, nil) + return +} diff --git a/openstack/gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go b/openstack/gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go index 31350f1cf..1d735200d 100644 --- a/openstack/gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go +++ b/openstack/gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go @@ -1 +1,17 @@ package parameter + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" +) + +func UpdateInstanceConfiguration(client *golangsdk.ServiceClient, opts UpdateInstanceNameOpts) (err error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return + } + + // PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/name + _, err = client.Put(client.ServiceURL("instances", opts.InstanceId, "name"), b, nil, nil) + return +} From 5df53d52d49f5c55233cc14976653e94382dd7ea Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 17:04:13 +0200 Subject: [PATCH 19/29] ApplyConfiguration --- .../v3/parameter/ApplyConfiguration.go | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/openstack/gaussdbnosql/v3/parameter/ApplyConfiguration.go b/openstack/gaussdbnosql/v3/parameter/ApplyConfiguration.go index 31350f1cf..b3f4a01f3 100644 --- a/openstack/gaussdbnosql/v3/parameter/ApplyConfiguration.go +++ b/openstack/gaussdbnosql/v3/parameter/ApplyConfiguration.go @@ -1 +1,40 @@ package parameter + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +type ApplyConfigurationRequest struct { + // Parameter template ID + ConfigId string + // Instance IDs + InstanceIds []string `json:"instance_ids"` +} + +func ApplyConfiguration(client *golangsdk.ServiceClient, opts UpdateConfigurationOpts) (*ApplyConfigurationResponse, error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return nil, err + } + + // PUT https://{Endpoint}/v3/{project_id}/configurations/{config_id}/apply + raw, err := client.Put(client.ServiceURL("configurations", opts.ConfigId, "apply"), b, nil, nil) + if err != nil { + return nil, err + } + + var res ApplyConfigurationResponse + err = extract.Into(raw.Body, &res) + return &res, err +} + +type ApplyConfigurationResponse struct { + // Asynchronous task ID of the application parameter template + JobId string `json:"job_id,omitempty"` + // Whether the parameter template application task is successfully submitted. + // If the value is true, the task is successfully submitted. + // If the value is false, the task fails to be submitted. + Success bool `json:"success,omitempty"` +} From b1ee5dd212cd131b87383045b4730f3a25e0c8c0 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 17:07:43 +0200 Subject: [PATCH 20/29] UpdateInstanceConfiguration --- .../parameter/UpdateInstanceConfiguration.go | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/openstack/gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go b/openstack/gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go index 1d735200d..159caa646 100644 --- a/openstack/gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go +++ b/openstack/gaussdbnosql/v3/parameter/UpdateInstanceConfiguration.go @@ -3,15 +3,35 @@ package parameter import ( golangsdk "github.com/opentelekomcloud/gophertelekomcloud" "github.com/opentelekomcloud/gophertelekomcloud/internal/build" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" ) -func UpdateInstanceConfiguration(client *golangsdk.ServiceClient, opts UpdateInstanceNameOpts) (err error) { +type UpdateInstanceConfigurationOpts struct { + InstanceId string + // The parameter values defined by users based on the default parameter template + Values map[string]string `json:"values"` +} + +func UpdateInstanceConfiguration(client *golangsdk.ServiceClient, opts UpdateInstanceConfigurationOpts) (*UpdateInstanceConfigurationResponse, error) { b, err := build.RequestBody(opts, "") if err != nil { - return + return nil, err } - // PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/name - _, err = client.Put(client.ServiceURL("instances", opts.InstanceId, "name"), b, nil, nil) - return + // PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/configurations + raw, err := client.Put(client.ServiceURL("instances", opts.InstanceId, "configurations"), b, nil, nil) + if err != nil { + return nil, err + } + + var res UpdateInstanceConfigurationResponse + err = extract.Into(raw.Body, &res) + return &res, err +} + +type UpdateInstanceConfigurationResponse struct { + // ID of the asynchronous task for modifying instance parameters + JobId string `json:"job_id,omitempty"` + // Whether the instance needs to be restarted. + RestartRequired bool `json:"restart_required,omitempty"` } From 635c1579ca6fb1c3c074ec0b5969ce4a0554a2d8 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 17:15:35 +0200 Subject: [PATCH 21/29] ShowInstanceConfiguration --- .../v3/parameter/ShowInstanceConfiguration.go | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/openstack/gaussdbnosql/v3/parameter/ShowInstanceConfiguration.go b/openstack/gaussdbnosql/v3/parameter/ShowInstanceConfiguration.go index 31350f1cf..466e76eb1 100644 --- a/openstack/gaussdbnosql/v3/parameter/ShowInstanceConfiguration.go +++ b/openstack/gaussdbnosql/v3/parameter/ShowInstanceConfiguration.go @@ -1 +1,49 @@ package parameter + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +func ShowInstanceConfiguration(client *golangsdk.ServiceClient, instanceId string) (*ShowInstanceConfigurationResponse, error) { + // GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/configurations + raw, err := client.Get(client.ServiceURL("instances", instanceId, "configurations"), nil, nil) + if err != nil { + return nil, err + } + + var res ShowInstanceConfigurationResponse + err = extract.Into(raw.Body, &res) + return &res, err +} + +type ShowInstanceConfigurationResponse struct { + // DB version name + DatastoreVersionName string `json:"datastore_version_name,omitempty"` + // Database name + DatastoreName string `json:"datastore_name,omitempty"` + // Creation time in the "yyyy-MM-ddTHH:mm:ssZ" format. + Created string `json:"created,omitempty"` + // Update time in the "yyyy-MM-ddTHH:mm:ssZ" format. + Updated string `json:"updated,omitempty"` + // The parameters defined by users based on the default parameter templates. + ConfigurationParameters []ConfigurationParameterResult `json:"configuration_parameters,omitempty"` +} + +type ConfigurationParameterResult struct { + // Parameter name + Name string `json:"name"` + // Parameter value + Value string `json:"value"` + // Whether the instance needs to be restarted. + RestartRequired bool `json:"restart_required"` + // Whether the parameter is read-only. + Readonly bool `json:"readonly"` + // Value range. For example, the value of the Integer type ranges from 0 to 1, + // and the value of the Boolean type is true or false. + ValueRange string `json:"value_range"` + // Parameter type. The value can be string, integer, boolean, list, or float. + Type string `json:"type"` + // Parameter description + Description string `json:"description"` +} From 01863f4152f6a108cf1e1c0f4e64bd205aa3e01f Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 17:27:13 +0200 Subject: [PATCH 22/29] ShowConfigurationDetail --- .../v3/parameter/ShowConfigurationDetail.go | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/openstack/gaussdbnosql/v3/parameter/ShowConfigurationDetail.go b/openstack/gaussdbnosql/v3/parameter/ShowConfigurationDetail.go index 31350f1cf..204690e2d 100644 --- a/openstack/gaussdbnosql/v3/parameter/ShowConfigurationDetail.go +++ b/openstack/gaussdbnosql/v3/parameter/ShowConfigurationDetail.go @@ -1 +1,37 @@ package parameter + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +func ShowConfigurationDetail(client *golangsdk.ServiceClient, configId string) (*ShowConfigurationDetailResponse, error) { + // GET https://{Endpoint}/v3/{project_id}/configurations/{config_id} + raw, err := client.Get(client.ServiceURL("configurations", configId), nil, nil) + if err != nil { + return nil, err + } + + var res ShowConfigurationDetailResponse + err = extract.Into(raw.Body, &res) + return &res, err +} + +type ShowConfigurationDetailResponse struct { + // Parameter template ID + Id string `json:"id,omitempty"` + // Parameter template name + Name string `json:"name,omitempty"` + // Parameter template description + Description string `json:"description,omitempty"` + // DB version name + DatastoreVersionName string `json:"datastore_version_name,omitempty"` + // Database name + DatastoreName string `json:"datastore_name,omitempty"` + // Creation time in the "yyyy-MM-ddTHH:mm:ssZ" format. + Created string `json:"created,omitempty"` + // Update time in the "yyyy-MM-ddTHH:mm:ssZ" format. + Updated string `json:"updated,omitempty"` + // The parameters defined by users based on the default parameter templates. + ConfigurationParameters []ConfigurationParameterResult `json:"configuration_parameters,omitempty"` +} From 28236d9445251a96883ba570399ea87f953c7cba Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 17:28:26 +0200 Subject: [PATCH 23/29] DeleteConfiguration --- .../gaussdbnosql/v3/parameter/DeleteConfiguration.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openstack/gaussdbnosql/v3/parameter/DeleteConfiguration.go b/openstack/gaussdbnosql/v3/parameter/DeleteConfiguration.go index 31350f1cf..a12ad155e 100644 --- a/openstack/gaussdbnosql/v3/parameter/DeleteConfiguration.go +++ b/openstack/gaussdbnosql/v3/parameter/DeleteConfiguration.go @@ -1 +1,9 @@ package parameter + +import golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + +func DeleteConfiguration(client *golangsdk.ServiceClient, configId string) (err error) { + // DELETE https://{Endpoint}/v3/{project_id}/configurations/{config_id} + _, err = client.Delete(client.ServiceURL("configurations", configId), nil) + return +} From 5f0502e055f3f3db963c357a036bd447aa8148d5 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 17:39:33 +0200 Subject: [PATCH 24/29] ListInstancesByResourceTags --- .../v3/tag/ListInstancesByResourceTags.go | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/openstack/gaussdbnosql/v3/tag/ListInstancesByResourceTags.go b/openstack/gaussdbnosql/v3/tag/ListInstancesByResourceTags.go index 686c0dfff..defd08dab 100644 --- a/openstack/gaussdbnosql/v3/tag/ListInstancesByResourceTags.go +++ b/openstack/gaussdbnosql/v3/tag/ListInstancesByResourceTags.go @@ -1 +1,87 @@ package tag + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +type ListInstancesByTagsOpts struct { + // Index position. The query starts from the next piece of data indexed by this parameter. + // If action is set to count, this parameter is not transferred. + // If action is set to filter, this parameter must be a positive integer. The default value is 0, + // indicating that the query starts from the first piece of data. + Offset string `json:"offset,omitempty"` + // Number of records to be queried. l If action is set to count, this parameter is not transferred. + // If action is set to filter, the value range is from 1 to 100. If this parameter is not transferred, + // the first 100 instances are queried by default. + Limit string `json:"limit,omitempty"` + // Specifies the operation identifier. + // If action is set to filter, instances are queried by tag filtering criteria. + // If action is set to count, only the total number of records is returned. + Action string `json:"action"` + // Field to be matched. + // If the value is left blank, the query is not based on the instance name or instance ID. + // If the value is not empty + Matches []MatchOption `json:"matches,omitempty"` + // Specifies the included tags. Each tag contains up to 20 keys. + Tags []TagOption `json:"tags,omitempty"` +} + +type TagOption struct { + // Tag key. It contains a maximum of 36 Unicode characters. key cannot be empty, an empty string, or spaces. + // Before using key, delete spaces of single-byte character (SBC) before and after the value. + // NOTE The character set of this parameter is not verified in the search process. + Key string `json:"key"` + // Lists the tag values. Each value contains a maximum of 43 Unicode characters and cannot contain spaces. + // Before using values, delete SBC spaces before and after the value. + // If the values are null, it indicates querying any value. The values are in OR relationship. + Values []string `json:"values"` +} + +type MatchOption struct { + // Query criteria. The value can be instance_name or instance_id, + // indicating that the query is based on the instance name or instance ID. + Key string `json:"key"` + // The name or ID of the instance to be matched. + Value string `json:"value"` +} + +func ListInstancesByResourceTags(client *golangsdk.ServiceClient, opts ListInstancesByTagsOpts) (*ListInstancesByResourceTagsResponse, error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return nil, err + } + + // POST https://{Endpoint}/v3/{project_id}/instances/resource_instances/action + raw, err := client.Post(client.ServiceURL("instances", "resource_instances", "action"), b, nil, nil) + if err != nil { + return nil, err + } + + var res ListInstancesByResourceTagsResponse + err = extract.Into(raw.Body, &res) + return &res, err +} + +type ListInstancesByResourceTagsResponse struct { + Instances []InstanceResult `json:"instances,omitempty"` + TotalCount int32 `json:"total_count,omitempty"` +} + +type InstanceResult struct { + // Instance ID + InstanceId string `json:"instance_id"` + // Instance name + InstanceName string `json:"instance_name"` + // Tag list. If there is no tag in the list, tags is taken as an empty array + Tags []InstanceTagResult `json:"tags"` +} + +type InstanceTagResult struct { + // Tag key. The value contains 36 Unicode characters and cannot be blank. Character set: 0-9, A-Z, a-z, "_", and "-". + Key string `json:"key,omitempty"` + // Tag value. The value contains a maximum of 43 Unicode characters and can also be an empty string. + // Character set: 0-9, A-Z, a-z, "_", and "-". + Value string `json:"value,omitempty"` +} From a80acaeba6d10a712338085ac93c0652a92ccffe Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 17:43:59 +0200 Subject: [PATCH 25/29] BatchTagAction --- .../gaussdbnosql/v3/tag/BatchTagAction.go | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/openstack/gaussdbnosql/v3/tag/BatchTagAction.go b/openstack/gaussdbnosql/v3/tag/BatchTagAction.go index 686c0dfff..ebc1965da 100644 --- a/openstack/gaussdbnosql/v3/tag/BatchTagAction.go +++ b/openstack/gaussdbnosql/v3/tag/BatchTagAction.go @@ -1 +1,40 @@ package tag + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/build" +) + +type BatchTagActionOpts struct { + InstanceId string + // Operation identifier. Valid value: + // create: indicates to add tags. + // delete: indicates to delete tags. + Action string `json:"action"` + // Tag list. + Tags []BatchTagActionTagOption `json:"tags"` +} + +type BatchTagActionTagOption struct { + // Tag key. It contains a maximum of 36 Unicode characters. It cannot be null or an empty string or contain spaces. + // Before verifying and using key, spaces are automatically filtered out. Character set: 0-9, A-Z, a-z, "_", and "-". + Key string `json:"key"` + // Tag value. It contains a maximum of 43 Unicode characters, can be an empty string, and cannot contain spaces. + // Before verifying or using value, spaces are automatically filtered out. + // Character set: 0-9, A-Z, a-z, "_", and "-". + // If action is set to create, this parameter is mandatory. + // If action is set to delete, this parameter is optional. + // NOTE If value is specified, tags are deleted by key and value. + // If value is not specified, tags are deleted by key. + Value string `json:"value,omitempty"` +} + +func BatchTagAction(client *golangsdk.ServiceClient, opts BatchTagActionOpts) (err error) { + b, err := build.RequestBody(opts, "") + if err != nil { + return + } + + // POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/tags/action + _, err = client.Post(client.ServiceURL("instances", opts.InstanceId, "tags", "action"), b, nil, nil) +} From f03b1ff09b0621a245e3c1f3f4a6ccb700d23f12 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 17:53:41 +0200 Subject: [PATCH 26/29] ListInstanceTags --- openstack/gaussdbnosql/v3/tag/BatchTagAction.go | 1 + .../gaussdbnosql/v3/tag/ListInstanceTags.go | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/openstack/gaussdbnosql/v3/tag/BatchTagAction.go b/openstack/gaussdbnosql/v3/tag/BatchTagAction.go index ebc1965da..b7c878341 100644 --- a/openstack/gaussdbnosql/v3/tag/BatchTagAction.go +++ b/openstack/gaussdbnosql/v3/tag/BatchTagAction.go @@ -37,4 +37,5 @@ func BatchTagAction(client *golangsdk.ServiceClient, opts BatchTagActionOpts) (e // POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/tags/action _, err = client.Post(client.ServiceURL("instances", opts.InstanceId, "tags", "action"), b, nil, nil) + return } diff --git a/openstack/gaussdbnosql/v3/tag/ListInstanceTags.go b/openstack/gaussdbnosql/v3/tag/ListInstanceTags.go index 686c0dfff..d2ecf10d4 100644 --- a/openstack/gaussdbnosql/v3/tag/ListInstanceTags.go +++ b/openstack/gaussdbnosql/v3/tag/ListInstanceTags.go @@ -1 +1,18 @@ package tag + +import ( + golangsdk "github.com/opentelekomcloud/gophertelekomcloud" + "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" +) + +func ListInstanceTags(client *golangsdk.ServiceClient, instanceId string) ([]InstanceTagResult, error) { + // GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/tags + raw, err := client.Get(client.ServiceURL("instances", instanceId, "tags"), nil, nil) + if err != nil { + return nil, err + } + + var res []InstanceTagResult + err = extract.IntoSlicePtr(raw.Body, &res, "tags") + return res, err +} From 31150b231f0e4ceaca28dbd980bbcc95cd8c568e Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 17:56:12 +0200 Subject: [PATCH 27/29] fix --- openstack/gaussdbnosql/v3/ListSlowLogs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openstack/gaussdbnosql/v3/ListSlowLogs.go b/openstack/gaussdbnosql/v3/ListSlowLogs.go index 08138465b..712da1ed3 100644 --- a/openstack/gaussdbnosql/v3/ListSlowLogs.go +++ b/openstack/gaussdbnosql/v3/ListSlowLogs.go @@ -34,7 +34,7 @@ func ListSlowLogs(client *golangsdk.ServiceClient, opts ListSlowLogsOpts) (*List } // GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/slowlog - raw, err := client.Get(client.ServiceURL("instances")+q.String(), nil, nil) + raw, err := client.Get(client.ServiceURL("instances", opts.InstanceId, "slowlog")+q.String(), nil, nil) if err != nil { return nil, err } From c13a6037059f186cc8822bc2d9f7f6a075fa0341 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 21:59:04 +0200 Subject: [PATCH 28/29] =?UTF-8?q?remove=20=EF=81=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openstack/gaussdbnosql/v3/ListFlavors.go | 16 +++++++------- openstack/gaussdbnosql/v3/ListSlowLogs.go | 2 +- .../v3/instance/CreateInstance.go | 22 +++++++++---------- .../gaussdbnosql/v3/instance/ListInstances.go | 20 ++++++++--------- .../v3/instance/ShrinkInstanceNode.go | 12 +++++----- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/openstack/gaussdbnosql/v3/ListFlavors.go b/openstack/gaussdbnosql/v3/ListFlavors.go index 3d0a96d79..6fd9884be 100644 --- a/openstack/gaussdbnosql/v3/ListFlavors.go +++ b/openstack/gaussdbnosql/v3/ListFlavors.go @@ -11,8 +11,8 @@ type ListFlavorsOpts struct { // The value cannot be empty. For details about how to obtain this parameter value, see Regions and Endpoints. Region string `q:"region"` // engine_name No Database type - //  If the value is cassandra, the GaussDB(for Cassandra) DB instance specifications are queried, - //  If this parameter is not transferred, the default value is cassandra. + // If the value is cassandra, the GaussDB(for Cassandra) DB instance specifications are queried, + // If this parameter is not transferred, the default value is cassandra. EngineName string `q:"engine_name,omitempty"` } @@ -52,16 +52,16 @@ type ListFlavorsResult struct { // Resource specification code // Example: geminidb.cassandra.8xlarge.4 // NOTE - //  geminidb.cassandra indicates GaussDB(for Cassandra). - //  8xlarge.4 indicates the single-node specifications. + // geminidb.cassandra indicates GaussDB(for Cassandra). + // 8xlarge.4 indicates the single-node specifications. SpecCode string `json:"spec_code"` // ID of the AZ that supports this specification // NOTE - //  This field is discarded and cannot be used. + // This field is discarded and cannot be used. AvailabilityZone []string `json:"availability_zone"` // Status of specifications in an AZ. The value can be: - //  normal: indicates that the specifications are on sale. - //  unsupported: not supported. - //  sellout: indicates that the instance specifications are sold out. + // normal: indicates that the specifications are on sale. + // unsupported: not supported. + // sellout: indicates that the instance specifications are sold out. AzStatus string `json:"az_status"` } diff --git a/openstack/gaussdbnosql/v3/ListSlowLogs.go b/openstack/gaussdbnosql/v3/ListSlowLogs.go index 08138465b..a12843609 100644 --- a/openstack/gaussdbnosql/v3/ListSlowLogs.go +++ b/openstack/gaussdbnosql/v3/ListSlowLogs.go @@ -16,7 +16,7 @@ type ListSlowLogsOpts struct { NodeId string `q:"node_id,omitempty"` // Statement type. If this parameter is left empty, all statement types are queried. // You can also specify the following log type: - //  SELECT + // SELECT Type string `q:"type,omitempty"` // Index offset. Its value range is [0, 1999]. // If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, diff --git a/openstack/gaussdbnosql/v3/instance/CreateInstance.go b/openstack/gaussdbnosql/v3/instance/CreateInstance.go index bd89b18e6..ce395740b 100644 --- a/openstack/gaussdbnosql/v3/instance/CreateInstance.go +++ b/openstack/gaussdbnosql/v3/instance/CreateInstance.go @@ -22,17 +22,17 @@ type CreateInstanceOpts struct { // Separate multiple AZs by commas (,). AvailabilityZone string `json:"availability_zone"` // VPC ID. To obtain this parameter value, use either of the following methods: - //  Method 1: Log in to VPC console and view the VPC ID on the VPC details page. - //  Method 2: See the "Querying VPCs" section in the Virtual Private Cloud API Reference. + // Method 1: Log in to VPC console and view the VPC ID on the VPC details page. + // Method 2: See the "Querying VPCs" section in the Virtual Private Cloud API Reference. VpcId string `json:"vpc_id"` // Network ID of the subnet. To obtain this parameter value, use either of the following methods: - //  Method 1: Log in to VPC console and click the target subnet on the Subnets page. You can view the subnet ID on the displayed page. - //  Method 2: See the "Querying Subnets" section in the Virtual Private Cloud API Reference. + // Method 1: Log in to VPC console and click the target subnet on the Subnets page. You can view the subnet ID on the displayed page. + // Method 2: See the "Querying Subnets" section in the Virtual Private Cloud API Reference. SubnetId string `json:"subnet_id"` // Security group ID. To obtain the security group ID, perform either of the following methods: - //  Method 1: Log in to VPC console. Choose Access Control > Security Groups in the navigation pane on the left. + // Method 1: Log in to VPC console. Choose Access Control > Security Groups in the navigation pane on the left. // On the displayed page, click the target security group. You can view the security group ID on the displayed page. - //  Method 2: See the "Querying Security Groups" section in the Virtual Private Cloud API Reference. + // Method 2: See the "Querying Security Groups" section in the Virtual Private Cloud API Reference. SecurityGroupId string `json:"security_group_id"` // Database password // The value must be 8 to 32 characters in length and contain uppercase letters (A to Z), @@ -40,7 +40,7 @@ type CreateInstanceOpts struct { // You are advised to enter a strong password to improve security, preventing security risks such as brute force cracking. Password string `json:"password"` // Instance type - //  GaussDB(for Cassandra) supports the cluster type. The value is "Cluster". + // GaussDB(for Cassandra) supports the cluster type. The value is "Cluster". Mode string `json:"mode"` // Instance specifications Flavor []InstanceFlavor `json:"flavor"` @@ -50,9 +50,9 @@ type CreateInstanceOpts struct { BackupStrategy BackupStrategy `json:"backup_strategy,omitempty"` // Specifies whether to enable or disable SSL. // Valid value: - //  The value "0" indicates that SSL is disabled by default. - //  The value "1" indicates that SSL is enabled by default. - //  If this parameter is not transferred, SSL is disabled by default. + // The value "0" indicates that SSL is disabled by default. + // The value "1" indicates that SSL is enabled by default. + // If this parameter is not transferred, SSL is disabled by default. SslOption string `json:"ssl_option,omitempty"` } @@ -121,7 +121,7 @@ type Datastore struct { type InstanceFlavor struct { // Node quantity - //  The number of GaussDB(for Cassandra) instance nodes ranges from 3 to 200. + // The number of GaussDB(for Cassandra) instance nodes ranges from 3 to 200. Num string `json:"num"` // Disk type // Valid value: ULTRAHIGH, which indicates the SSD disk. diff --git a/openstack/gaussdbnosql/v3/instance/ListInstances.go b/openstack/gaussdbnosql/v3/instance/ListInstances.go index 9ab550792..25187be1b 100644 --- a/openstack/gaussdbnosql/v3/instance/ListInstances.go +++ b/openstack/gaussdbnosql/v3/instance/ListInstances.go @@ -23,12 +23,12 @@ type ListInstancesOpts struct { // If this parameter is not transferred, all DB instances are queried. DatastoreType string `q:"datastore_type,omitempty"` // VPC ID. To obtain this parameter value, use either of the following methods: - //  Method 1: Log in to VPC console and view the VPC ID on the VPC details page. - //  Method 2: See the "Querying VPCs" section in the Virtual Private Cloud API Reference. + // Method 1: Log in to VPC console and view the VPC ID on the VPC details page. + // Method 2: See the "Querying VPCs" section in the Virtual Private Cloud API Reference. VpcId string `q:"vpc_id,omitempty"` // Network ID of the subnet. To obtain this parameter value, use either of the following methods: - //  Method 1: Log in to VPC console and click the target subnet on the Subnets page. You can view the subnet ID on the displayed page. - //  Method 2: See the "Querying Subnets" section in the Virtual Private Cloud API Reference. + // Method 1: Log in to VPC console and click the target subnet on the Subnets page. You can view the subnet ID on the displayed page. + // Method 2: See the "Querying Subnets" section in the Virtual Private Cloud API Reference. SubnetId string `q:"subnet_id,omitempty"` // Index position. The query starts from the next instance creation time indexed by this parameter under a specified project. // If offset is set to N, the resource query starts from the N+1 piece of data @@ -69,12 +69,12 @@ type ListInstancesResult struct { Name string `json:"name"` // Instance status // Valid value: - //  normal: indicates that the instance is running properly. - //  abnormal: indicates that the instance is abnormal. - //  creating: indicates that the instance is being created. - //  data_disk_full: indicates that the instance disk is full. - //  createfail: indicates that the instance failed to be created. - //  enlargefail: indicates that nodes failed to be added to the instance. + // normal: indicates that the instance is running properly. + // abnormal: indicates that the instance is abnormal. + // creating: indicates that the instance is being created. + // data_disk_full: indicates that the instance disk is full. + // createfail: indicates that the instance failed to be created. + // enlargefail: indicates that nodes failed to be added to the instance. Status string `json:"status"` // Database port Port string `json:"port"` diff --git a/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go b/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go index ec1e8e148..4dd4e71a3 100644 --- a/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go +++ b/openstack/gaussdbnosql/v3/instance/ShrinkInstanceNode.go @@ -14,13 +14,13 @@ type ShrinkInstanceNodeOpts struct { Num int32 `json:"num,omitempty"` // The ID of the node to be deleted. The node must support scale-in. If this parameter is not transferred, the number of nodes to be deleted is specified based on the internal policy of the system. // NOTE - //  Either num or node_list must be set. - //  If num is transferred, the value must be 1. - //  If node_list is transferred, the value must be 1. - //  If the values of num and node_list are transferred at the same time, the value of node_list is used. - //  If the value of node_list is empty, scale-in is performed on random nodes. + // Either num or node_list must be set. + // If num is transferred, the value must be 1. + // If node_list is transferred, the value must be 1. + // If the values of num and node_list are transferred at the same time, the value of node_list is used. + // If the value of node_list is empty, scale-in is performed on random nodes. // If the value of node_list is not empty, the scale-in is performed based on the specified node ID. - //  Before scale-in, do not directly connect a node to prevent service interruption caused by scale-in. + // Before scale-in, do not directly connect a node to prevent service interruption caused by scale-in. NodeList []string `json:"node_list,omitempty"` } From bc9cc3ab75fa32a98c84bbdfd74785f4e0b46508 Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Wed, 28 Sep 2022 22:00:32 +0200 Subject: [PATCH 29/29] remove apiversion --- openstack/gaussdbnosql/v3/apiversion/ListApiVersion.go | 1 - openstack/gaussdbnosql/v3/apiversion/ShowApiVersion.go | 1 - 2 files changed, 2 deletions(-) delete mode 100644 openstack/gaussdbnosql/v3/apiversion/ListApiVersion.go delete mode 100644 openstack/gaussdbnosql/v3/apiversion/ShowApiVersion.go diff --git a/openstack/gaussdbnosql/v3/apiversion/ListApiVersion.go b/openstack/gaussdbnosql/v3/apiversion/ListApiVersion.go deleted file mode 100644 index 2f7894f13..000000000 --- a/openstack/gaussdbnosql/v3/apiversion/ListApiVersion.go +++ /dev/null @@ -1 +0,0 @@ -package apiversion diff --git a/openstack/gaussdbnosql/v3/apiversion/ShowApiVersion.go b/openstack/gaussdbnosql/v3/apiversion/ShowApiVersion.go deleted file mode 100644 index 2f7894f13..000000000 --- a/openstack/gaussdbnosql/v3/apiversion/ShowApiVersion.go +++ /dev/null @@ -1 +0,0 @@ -package apiversion