Documentation
¶
Index ¶
- func CreateSnapshot(client *golangsdk.ServiceClient, opts Snapshot) (string, error)
- func DeleteSnapshot(client *golangsdk.ServiceClient, snapshotId string) error
- func RestoreCluster(client *golangsdk.ServiceClient, opts RestoreClusterOpts) (string, error)
- func WaitForRestore(c *golangsdk.ServiceClient, id string, secs int) error
- func WaitForSnapshot(c *golangsdk.ServiceClient, cid, id string, secs int) error
- type ListSnapshotsResponse
- type RestoreClusterOpts
- type Snapshot
- type SnapshotDetail
- type Snapshots
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSnapshot ¶
func CreateSnapshot(client *golangsdk.ServiceClient, opts Snapshot) (string, error)
func DeleteSnapshot ¶
func DeleteSnapshot(client *golangsdk.ServiceClient, snapshotId string) error
func RestoreCluster ¶
func RestoreCluster(client *golangsdk.ServiceClient, opts RestoreClusterOpts) (string, error)
func WaitForRestore ¶
func WaitForRestore(c *golangsdk.ServiceClient, id string, secs int) error
func WaitForSnapshot ¶
func WaitForSnapshot(c *golangsdk.ServiceClient, cid, id string, secs int) error
Types ¶
type ListSnapshotsResponse ¶
type ListSnapshotsResponse struct {
// List of snapshot objects
Snapshots []Snapshots `json:"snapshots,omitempty"`
// Total number of snapshot objects
Count int `json:"count,omitempty"`
}
func ListSnapshot ¶
func ListSnapshot(client *golangsdk.ServiceClient) (*ListSnapshotsResponse, error)
type RestoreClusterOpts ¶
type RestoreClusterOpts struct {
// ID of the snapshot to be restored
SnapshotId string `json:"-"`
// Cluster name, which must be unique. The cluster name must contain 4 to 64 characters, which must start with a letter.
// Only letters, digits, hyphens (-), and underscores (_) are allowed.
Name string `json:"name" required:"true"`
// Subnet ID, which is used for configuring cluster network. The default value is the same as that of the original cluster.
SubnetId string `json:"subnet_id,omitempty"`
// Security group ID, which is used for configuring cluster network. The default value is the same as that of the original cluster.
SecurityGroupId string `json:"security_group_id,omitempty"`
// VPC ID, which is used for configuring cluster network. The default value is the same as that of the original cluster.
VpcId string `json:"vpc_id,omitempty"`
// AZ of a cluster. The default value is the same as that of the original cluster.
AvailabilityZone string `json:"availability_zone,omitempty"`
// Service port of a cluster. The value ranges from 8000 to 30000. The default value is 8000.
Port int `json:"port,omitempty"`
// Public IP address. If the parameter is not specified, public connection is not used by default.
PublicIp cluster.PublicIp `json:"public_ip,omitempty"`
// Enterprise project. The default enterprise project ID is 0.
EnterpriseProjectId string `json:"enterprise_project_id,omitempty"`
}
type Snapshot ¶
type Snapshot struct {
// Snapshot name, which must be unique and start with a letter.
// It consists of 4 to 64 characters, which are case-insensitive and contain letters, digits, hyphens (-), and underscores (_) only.
Name string `json:"name" required:"true"`
// ID of the cluster for which you want to create a snapshot. For details about how to obtain the ID, see 7.6 Obtaining the Cluster ID.
ClusterId string `json:"cluster_id" required:"true"`
// Snapshot description. If no value is specified, the description is empty. Enter a maximum of 256 characters.
// The following special characters are not allowed: !<>'=&"
Description string `json:"description,omitempty"`
}
type SnapshotDetail ¶
type SnapshotDetail struct {
// Snapshot ID
Id string `json:"id"`
// Snapshot name
Name string `json:"name"`
// Snapshot description
Description string `json:"description"`
// Time when a snapshot starts to be created. Format: ISO8601: YYYY-MM-DDThh:mm:ssZ
Started string `json:"started"`
// Time when a snapshot is complete. Format: ISO8601: YYYY-MM-DDThh:mm:ssZ
Finished string `json:"finished"`
// Snapshot size, in GB
Size float64 `json:"size"`
// Snapshot status:
// CREATING
// AVAILABLE
// UNAVAILABLE
Status string `json:"status"`
// Snapshot type. It can be:
// MANUAL
// AUTOMATED
Type string `json:"type"`
// ID of the cluster for which snapshots are created For details about how to obtain the ID, see 7.6 Obtaining the Cluster ID.
ClusterId string `json:"cluster_id"`
}
func ListSnapshotDetails ¶
func ListSnapshotDetails(client *golangsdk.ServiceClient, snapshotId string) (*SnapshotDetail, error)
type Snapshots ¶
type Snapshots struct {
// Snapshot ID
Id string `json:"id"`
// Snapshot name
Name string `json:"name"`
// Snapshot description
Description string `json:"description"`
// Time when a snapshot starts to be created. Format: ISO8601: YYYY-MM-DDThh:mm:ssZ
Started string `json:"started"`
// Time when a snapshot is complete. Format: ISO8601: YYYY-MM-DDThh:mm:ssZ
Finished string `json:"finished"`
// Snapshot size, in GB
Size float64 `json:"size"`
// Snapshot status:
// CREATING
// AVAILABLE
// UNAVAILABLE
Status string `json:"status"`
// Snapshot type. It can be:
// MANUAL
// AUTOMATED
Type string `json:"type"`
// ID of the cluster for which snapshots are created For details about how to obtain the ID, see 7.6 Obtaining the Cluster ID.
ClusterId string `json:"cluster_id"`
}
Click to show internal directories.
Click to hide internal directories.