Documentation
¶
Index ¶
- func Delete(client *golangsdk.ServiceClient, instanceId string, deleteRdsData bool) (*string, error)
- func ModifySecurityGroup(client *golangsdk.ServiceClient, instanceId string, ...) (*string, error)
- func ReloadTableData(client *golangsdk.ServiceClient, instanceId string) error
- func Rename(client *golangsdk.ServiceClient, instanceId string, name string) (*string, error)
- type CreateInstanceDetail
- type CreateOpts
- type DeleteQueryParams
- type GetDetailNodesInfo
- type Instance
- type InstancesPage
- type Job
- type ModifyNameResponse
- type ModifySecurityGroupOpts
- type ModifySecurityGroupResponse
- type NodeList
- type NodesPage
- type QueryInstanceDetailsResponse
- type QueryInstancesOpts
- type QueryInstancesResponse
- type QueryNodeDetailsResponse
- type QueryNodesOpts
- type QueryNodesResponse
- type ResponseInstance
- type RestartInstanceInfo
- type RestartOpts
- type ShowInstanceBeanResponse
- type SyncDataNodesInfoResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(client *golangsdk.ServiceClient, instanceId string, deleteRdsData bool) (*string, error)
Delete function is used to delete a DDM instance to release all its resources.
func ModifySecurityGroup ¶
func ModifySecurityGroup(client *golangsdk.ServiceClient, instanceId string, opts ModifySecurityGroupOpts) (*string, error)
ModifySecurityGroup function is used to modify the security group of a DDM instance.
func ReloadTableData ¶
func ReloadTableData(client *golangsdk.ServiceClient, instanceId string) error
ReloadTableData function is used to reload table data of the destination DDM instance for cross-region DR.
Types ¶
type CreateInstanceDetail ¶
type CreateInstanceDetail struct {
// Instance name. The value can contain 4 to 64 characters, including letters, digits and hyphens (-).
// Must start with a letter
Name string `json:"name" required:"true"`
// Specifies the class ID
FlavorId string `json:"flavor_id" required:"true"`
// Specifies the number of nodes
NodeNum int `json:"node_num" required:"true"`
// Specifies the Engine ID
EngineId string `json:"engine_id" required:"true"`
// Specifies the AZ codes. The value cannot be empty.
AvailableZones []string `json:"available_zones" required:"true"`
// Specifies the VPC ID
VpcId string `json:"vpc_id" required:"true"`
// Specifies the Security group ID
SecurityGroupId string `json:"security_group_id" required:"true"`
// Specifies the Subnet ID
SubnetId string `json:"subnet_id" required:"true"`
// Specifies the Parameter group ID
ParamGroupId string `json:"param_group_id,omitempty"`
// Time Zone. Default value is UTC. The value can be UTC, UTC-12:00, UTC-11:00, ..., UTC+12:00
TimeZone string `json:"time_zone,omitempty"`
// Username of the administrator. The username can contain 1 to 32 characters. It must start with a letter.
// It can only contain letters, digits, and underscores (_)
AdminUserName string `json:"admin_user_name,omitempty"`
// Password of the administrator. The password can include 8 to 32 characters. It must be a combination of
// uppercase letters, lowercase letters, digits, and the following special characters:
// ~ ! @ # % ^ * - _ = + ?
AdminUserPassword string `json:"admin_user_password,omitempty"`
}
type CreateOpts ¶
type CreateOpts struct {
// Instance Information. Value is of the type CreateInstanceDetail
Instance CreateInstanceDetail `json:"instance" required:"true"`
}
type DeleteQueryParams ¶
type DeleteQueryParams struct {
// Query param: ?delete_rds_data
// This specifies whether data stored on the associated DB instances is deleted.
// Default value: delete_rds_data=false.
DeleteRdsData string `q:"delete_rds_data"`
}
type GetDetailNodesInfo ¶
type GetDetailNodesInfo struct {
// Status of the DDM instance node. For details, see Status Description at
// https://docs.otc.t-systems.com/distributed-database-middleware/api-ref/appendix/status_description.html
Status string `json:"status"`
// Port of the DDM instance node
Port string `json:"port"`
// IP address of the DDM instance node
IP string `json:"ip"`
}
type Instance ¶
type Instance struct {
// Indicates the DDM instance ID.
Id string `json:"id"`
// ID of the order
OrderId string `json:"order_id"`
// ID of the job for creating an instance.
JobId string `json:"job_id"`
}
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*Instance, error)
Create function is used to create a DDM instance
type InstancesPage ¶
type InstancesPage struct {
pagination.NewSinglePageBase
}
type ModifyNameResponse ¶
type ModifyNameResponse struct {
Name string `json:"name"`
}
type ModifySecurityGroupOpts ¶
type ModifySecurityGroupOpts struct {
// Security group ID. The default value is the original security group ID. You can change the value as required.
SecurityGroupId string `json:"security_group_id" required:"true"`
}
type ModifySecurityGroupResponse ¶
type ModifySecurityGroupResponse struct {
// Security group ID. The default value is the original security group ID. You can change the value as required.
SecurityGroupId string `json:"security_group_id"`
}
type NodeList ¶
type NodeList struct {
// Port
Port string `json:"port"`
// Node status. For details, see Status Description at:
// https://docs.otc.t-systems.com/distributed-database-middleware/api-ref/appendix/status_description.html
Status string `json:"status"`
// Node ID
NodeID string `json:"node_id"`
// IP address
IP string `json:"ip"`
}
func ExtractNodes ¶
func ExtractNodes(r pagination.NewPage) ([]NodeList, error)
func QueryNodes ¶
func QueryNodes(client *golangsdk.ServiceClient, instanceId string, opts QueryNodesOpts) ([]NodeList, error)
QueryNodes function is used to query nodes of a DDM instance.
type NodesPage ¶
type NodesPage struct {
pagination.NewSinglePageBase
}
type QueryInstanceDetailsResponse ¶
type QueryInstanceDetailsResponse struct {
// DDM instance ID
Id string `json:"id"`
// DDM instance status. For details about this parameter value, see Status Description at
// https://docs.otc.t-systems.com/distributed-database-middleware/api-ref/appendix/status_description.html
Status string `json:"status"`
// DDM instance name
Name string `json:"name"`
// Time when the DDM instance is created
Created string `json:"created"`
// Time when the DDM instance is last updated
Updated string `json:"updated"`
// Name of the AZ where the DDM instance is located
AvailableZone string `json:"available_zone"`
// VPC ID
VpcId string `json:"vpc_id"`
// Subnet ID
SubnetId string `json:"subnet_id"`
// Security group ID
SecurityGroupId string `json:"security_group_id"`
// Number of nodes
NodeCount int `json:"node_count"`
// Address for accessing the DDM instance
AccessIp string `json:"access_ip"`
// Port for accessing the DDM instance
AccessPort string `json:"access_port"`
// Node status. For details, see Status Description.
NodeStatus string `json:"node_status"`
// Number of CPUs
CoreCount string `json:"core_count"`
// Memory size in GB
RamCapacity string `json:"ram_capacity"`
// Response message. This parameter is not returned if no abnormality occurs.
ErrorMsg string `json:"error_msg,omitempty"`
// Project ID
ProjectId string `json:"project_id"`
// The function has not been supported, and this field is reserved.
OrderId string `json:"order_id"`
// Engine version (core instance version)
EngineVersion string `json:"engine_version"`
// Node information
Nodes []GetDetailNodesInfo `json:"nodes"`
// Username of the administrator. The username: Can include 1 to 32 characters. Must start with a letter. Can contain only letters, digits, and underscores (_).
AdminUserName string `json:"admin_user_name"`
}
func QueryInstanceDetails ¶
func QueryInstanceDetails(client *golangsdk.ServiceClient, instanceId string) (*QueryInstanceDetailsResponse, error)
QueryInstanceDetails is used to query details about a DDM instance.
type QueryInstancesOpts ¶
type QueryInstancesOpts struct {
// Specifies the Index offset.
// The query starts from the next piece of data indexed by this parameter. The value is 0 by default.
// The value must be a positive integer.
Offset int `q:"offset"`
// A maximum of instances to be queried.
// Value range: 1 to 128.
// If the parameter value is not specified, 10 DDM instances are queried by default.
Limit int `q:"limit"`
}
type QueryInstancesResponse ¶
type QueryInstancesResponse struct {
// DDM instance information.
Instances []ShowInstanceBeanResponse `json:"instances"`
// Number of DDM instances of a tenant.
InstanceNum int `json:"instance_num"`
// Current page.
PageNo int `json:"page_no"`
// Data records on the current page.
PageSize int `json:"page_size"`
// Total records.
TotalRecord int `json:"total_record"`
// Total pages.
TotalPage int `json:"total_page"`
}
type QueryNodeDetailsResponse ¶
type QueryNodeDetailsResponse struct {
// Node status. For details, see Status Description at:
// https://docs.otc.t-systems.com/distributed-database-middleware/api-ref/appendix/status_description.html
Status string `json:"status"`
// Node name
Name string `json:"name"`
// Node ID
NodeID string `json:"node_id"`
// Private IP address of the node
PrivateIP string `json:"private_ip"`
// Floating IP address of the node
FloatingIP string `json:"floating_ip"`
// VM ID
ServerID string `json:"server_id"`
// Subnet name
SubnetName string `json:"subnet_name"`
// Data disk ID
DataVolumeID string `json:"datavolume_id"`
// IP address provided by the resource subnet
ResSubnetIP string `json:"res_subnet_ip"`
// System disk ID
SystemVolumeID string `json:"systemvolume_id"`
}
func QueryNodeDetails ¶
func QueryNodeDetails(client *golangsdk.ServiceClient, instanceId string, nodeId string) (*QueryNodeDetailsResponse, error)
QueryNodeDetails is used to query details of a DDM instance node.
type QueryNodesOpts ¶
type QueryNodesOpts struct {
// Specifies the Index offset.
// The query starts from the next piece of data indexed by this parameter. The value is 0 by default.
// The value must be a positive integer.
Offset int `q:"offset"`
// A maximum of nodes to be queried.
// Value range: 1 to 128.
// If the parameter value is not specified, 10 nodes are queried by default.
Limit int `q:"limit"`
}
type QueryNodesResponse ¶
type ResponseInstance ¶
type ResponseInstance struct {
// DDM instance ID
InstanceId string `json:"instanceId"`
// DDM instance name
InstanceName string `json:"instanceName"`
// Task ID
JobId string `json:"jobId"`
}
func RestartInstance ¶
func RestartInstance(client *golangsdk.ServiceClient, instanceId string, opts RestartOpts) (*ResponseInstance, error)
RestartInstance function is used to restart a DDM instance. Specify Restart in the RestartOpts for proper result.
type RestartInstanceInfo ¶
type RestartInstanceInfo struct {
// Restart type, which can be soft or hard.
// soft: Only the process is restarted.
// hard: The instance VM is forcibly restarted.
// Enumerated values:
// soft
// hard
Type string `json:"type,omitempty"`
}
type RestartOpts ¶
type RestartOpts struct {
// Restart-related parameter. Value is of the type RestartInstanceInfo
Restart RestartInstanceInfo `json:"restart,omitempty"`
}
type ShowInstanceBeanResponse ¶
type ShowInstanceBeanResponse struct {
// DDM instance ID.
Id string `json:"id"`
// DDM instance status.
Status string `json:"status"`
// Name of the created DDM instance.
Name string `json:"name"`
// Time when the DDM instance is created.
Created string `json:"created"`
// Time when the DDM instance is last updated.
Updated string `json:"updated"`
// AZ name.
AvailableZone string `json:"available_zone"`
// VPC ID.
VpcId string `json:"vpc_id"`
// Subnet ID.
SubnetId string `json:"subnet_id"`
// Security group ID.
SecurityGroupId string `json:"security_group_id"`
// Number of nodes.
NodeCount int `json:"node_count"`
// Address for accessing the DDM instance.
AccessIp string `json:"access_ip"`
// Port for accessing the DDM instance.
AccessPort string `json:"access_port"`
// Number of CPUs.
CoreCount string `json:"core_count"`
// Memory size in GB.
RamCapacity string `json:"ram_capacity"`
// Response message. Not returned if no abnormality occurs.
ErrorMsg string `json:"error_msg,omitempty"`
// Node status.
NodeStatus string `json:"node_status"`
// Project ID of a tenant in a region.
ProjectId string `json:"project_id"`
// Engine version (core instance version).
EngineVersion string `json:"engine_version"`
}
func ExtractInstances ¶
func ExtractInstances(r pagination.NewPage) ([]ShowInstanceBeanResponse, error)
func QueryInstances ¶
func QueryInstances(client *golangsdk.ServiceClient, opts QueryInstancesOpts) ([]ShowInstanceBeanResponse, error)
QueryInstances function is used to query DDM instances.
type SyncDataNodesInfoResponse ¶
type SyncDataNodesInfoResponse struct {
// DDM instance ID
InstanceId string `json:"instanceId"`
// Task ID
JobId string `json:"jobId"`
}
func SyncDataNodesInfo ¶
func SyncDataNodesInfo(client *golangsdk.ServiceClient, instanceId string) (*SyncDataNodesInfoResponse, error)
SyncDataNodesInfo is used to synchronize configuration information of all data nodes that are associated with a DDM instance.