Documentation ¶
Index ¶
- func BatchDeleteScalingConfigs(client *golangsdk.ServiceClient, opts BatchDeleteOpts) (err error)
- func Create(client *golangsdk.ServiceClient, opts CreateOpts) (string, error)
- func Delete(client *golangsdk.ServiceClient, id string) (err error)
- type AdminPassMetadata
- type Bandwidth
- type BatchDeleteOpts
- type Configuration
- type CreateOpts
- type Disk
- type Eip
- type InstanceConfig
- type InstanceConfigOpts
- type ListOpts
- type ListScalingConfigsResponse
- type Personality
- type PublicIp
- type SecurityGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchDeleteScalingConfigs ¶ added in v0.5.25
func BatchDeleteScalingConfigs(client *golangsdk.ServiceClient, opts BatchDeleteOpts) (err error)
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOpts) (string, error)
Types ¶
type AdminPassMetadata ¶ added in v0.5.25
type AdminPassMetadata struct { // Specifies the initial login password of the administrator account for logging in to an ECS using password authentication. // The Linux administrator is root, and the Windows administrator is Administrator. // // Password complexity requirements: // Consists of 8 to 26 characters. // Contains at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters !@$%^-_=+[{}]:,./? // The password cannot contain the username or the username in reversed order. // The Windows ECS password cannot contain the username, the username in reversed order, or more than two consecutive characters in the username. AdminPass string `json:"admin_pass,omitempty"` }
type Bandwidth ¶
type Bandwidth struct { // Specifies the bandwidth (Mbit/s). The value range is 1 to 500. // NOTE: // The specific range may vary depending on the configuration in each region. // You can see the bandwidth range of each region on the management console. // The minimum unit for bandwidth varies depending on the bandwidth range. // The minimum unit is 1 Mbit/s if the allowed bandwidth size ranges from 0 to 300 Mbit/s (with 300 Mbit/s included). // The minimum unit is 50 Mbit/s if the allowed bandwidth size ranges 300 Mbit/s to 500 Mbit/s (with 500 Mbit/s included). Size int `json:"size"` // Enumerated values of the sharing type: // PER: dedicated // Only dedicated bandwidth is available. ShareType string `json:"share_type"` // Specifies the bandwidth billing mode. // traffic: billed by traffic. // If the parameter value is out of the preceding options, creating the ECS will fail. ChargingMode string `json:"charging_mode"` }
type BatchDeleteOpts ¶ added in v0.5.25
type BatchDeleteOpts struct {
ScalingConfigurationId []string `json:"scaling_configuration_id"`
}
type Configuration ¶
type Configuration struct { // Specifies the AS configuration ID. This parameter is globally unique. ID string `json:"scaling_configuration_id"` // Specifies the tenant ID. Tenant string `json:"tenant"` // Specifies the AS configuration name. // Supports fuzzy search. Name string `json:"scaling_configuration_name"` // Specifies the information about instance configurations. InstanceConfig InstanceConfig `json:"instance_config"` // Specifies the time when AS configurations are created. The time format complies with UTC. CreateTime string `json:"create_time"` // Specifies the ID of the AS group to which the AS configuration is bound. ScalingGroupId string `json:"scaling_group_id,omitempty"` }
func Get ¶
func Get(client *golangsdk.ServiceClient, id string) (*Configuration, error)
type CreateOpts ¶
type CreateOpts struct { // Specifies the AS configuration name. // The name contains only letters, digits, underscores (_), and hyphens (-), and cannot exceed 64 characters. Name string `json:"scaling_configuration_name" required:"true"` // Specifies the ECS configuration. InstanceConfig InstanceConfigOpts `json:"instance_config" required:"true"` }
type Disk ¶
type Disk struct { // Specifies the disk size. The unit is GB. // The system disk size ranges from 1 to 1024 and must be greater than or equal to the // minimum size (min_disk value) of the system disk specified in the image. // The data disk size ranges from 10 to 32768. Size int `json:"size"` // Specifies the ECS system disk type. The disk type must match the available disk type. // SATA: common I/O disk type // SAS: high I/O disk type // SSD: ultra-high I/O disk type // co-p1: high I/O (performance-optimized I) disk type // uh-l1: ultra-high I/O (latency-optimized) disk type // If the specified disk type is not available in the AZ, the disk will fail to create. // NOTE: // For HANA, HL1, and HL2 ECSs, use co-p1 and uh-l1 disks. For other ECSs, do not use co-p1 or uh-l1 disks. VolumeType string `json:"volume_type"` // Specifies the ECS system disk type. The disk type must match the available disk type. // SATA: common I/O disk type // SAS: high I/O disk type // SSD: ultra-high I/O disk type // co-p1: high I/O (performance-optimized I) disk type // uh-l1: ultra-high I/O (latency-optimized) disk type // If the specified disk type is not available in the AZ, the disk will fail to create. // NOTE: // For HANA, HL1, and HL2 ECSs, use co-p1 and uh-l1 disks. For other ECSs, do not use co-p1 or uh-l1 disks. DiskType string `json:"disk_type"` // Specifies a DSS device ID for creating an ECS disk. // NOTE: // Specify DSS devices for all disks in an AS configuration or not. If DSS devices are specified, // all the data stores must belong to the same AZ, and the disk types supported by a DSS device for a disk // must be the same as the volume_type value. DedicatedStorageID string `json:"dedicated_storage_id"` // Specifies the ID of a data disk image used to export data disks of an ECS. DataDiskImageID string `json:"data_disk_image_id"` // Specifies the disk backup snapshot ID for restoring the system disk // and data disks using a full-ECS backup when a full-ECS image is used. // NOTE: // Each disk in an AS configuration must correspond to a disk backup in the full-ECS backup by snapshot_id. SnapshotID string `json:"snapshot_id"` // Specifies the metadata for creating disks. Metadata map[string]interface{} `json:"metadata"` }
type InstanceConfig ¶
type InstanceConfig struct { // Specifies the ECS flavor ID. FlavorRef string `json:"flavorRef"` // Specifies the image ID. It is same as image_id. ImageRef string `json:"imageRef"` // Specifies the disk group information. Disk []Disk `json:"disk"` // Specifies the name of the SSH key pair used to log in to the ECS. SSHKey string `json:"key_name"` // Specifies the fingerprint of the SSH key pair used to log in to the ECS. KeyFingerprint string `json:"key_fingerprint"` // This parameter is reserved. InstanceName string `json:"instance_name"` // This parameter is reserved. InstanceID string `json:"instance_id"` // This parameter is reserved. AdminPass string `json:"adminPass"` // Specifies information about the injected file. Personality []Personality `json:"personality"` // Specifies the EIP of the ECS. PublicIp PublicIp `json:"public_ip"` // Specifies the Cloud-Init user data, which is encoded using Base64. UserData string `json:"user_data"` // Specifies the ECS metadata. Metadata AdminPassMetadata `json:"metadata"` // Specifies the security group information. SecurityGroups []SecurityGroup `json:"security_groups"` // This parameter is reserved. ServerGroupID string `json:"server_group_id"` // This parameter is reserved. Tenancy string `json:"tenancy"` // This parameter is reserved. DedicatedHostID string `json:"dedicated_host_id"` // This parameter is reserved. MarketType string `json:"market_type"` // This parameter is reserved. MultiFlavorPriorityPolicy string `json:"multi_flavor_priority_policy"` }
type InstanceConfigOpts ¶
type InstanceConfigOpts struct { // Specifies the ECS ID. When using the existing ECS specifications as the template to create AS configurations, // specify this parameter. In this case, the flavorRef, imageRef, disk, and security_groups fields do not take effect. // If the instance_id field is not specified, flavorRef, imageRef, and disk fields are mandatory. ID string `json:"instance_id,omitempty"` // Specifies the ECS flavor ID. A maximum of 10 flavors can be selected. Use a comma (,) to separate multiple flavor IDs. // You can obtain its value from the API for querying details about flavors and extended flavor information. FlavorRef string `json:"flavorRef,omitempty"` // Specifies the image ID. Its value is the same as that of image_id for specifying the image selected during ECS creation. // Obtain the value using the API for querying images. ImageRef string `json:"imageRef,omitempty"` // Specifies the disk group information. System disks are mandatory and data disks are optional. Disk []Disk `json:"disk,omitempty"` // Specifies the name of the SSH key pair used to log in to the ECS. SSHKey string `json:"key_name" required:"true"` // Specifies information about the injected file. Only text files can be injected. // A maximum of five files can be injected at a time and the maximum size of each file is 1 KB. Personality []Personality `json:"personality,omitempty"` // Specifies the EIP of the ECS. The EIP can be configured in two ways. // Do not use an EIP. In this case, this parameter is unavailable. // Automatically assign an EIP. You need to specify the information about the new EIP. PubicIp *PublicIp `json:"public_ip,omitempty"` // Specifies the user data to be injected during the ECS creation process. Text, text files, and gzip files can be injected. // Constraints: // The content to be injected must be encoded with base64. The maximum size of the content to be injected (before encoding) is 32 KB. // Examples: // Linux // #! /bin/bash // echo user_test >> /home/user.txt // Windows // rem cmd // echo 111 > c:\aaa.txt UserData []byte `json:"-"` // Specifies the ECS metadata. Metadata AdminPassMetadata `json:"metadata,omitempty"` // Specifies security groups. // If the security group is specified both in the AS configuration and AS group, scaled ECS instances // will be added to the security group specified in the AS configuration. // If the security group is not specified in either of them, scaled ECS instances will be added to the default security group. // For your convenience, you are advised to specify the security group in the AS configuration. SecurityGroups []SecurityGroup `json:"security_groups,omitempty"` // This parameter is reserved. MarketType string `json:"market_type,omitempty"` }
type ListOpts ¶
type ListOpts struct { // Specifies the AS configuration name. // Supports fuzzy search. Name string `q:"scaling_configuration_name"` // Specifies the image ID. It is same as imageRef. ImageID string `q:"image_id"` // Specifies the start line number. The default value is 0. The minimum parameter value is 0. StartNumber int `q:"start_number"` // Specifies the number of query records. The default value is 20. The value range is 0 to 100. Limit int `q:"limit"` }
type ListScalingConfigsResponse ¶ added in v0.5.25
type ListScalingConfigsResponse struct { TotalNumber int32 `json:"total_number,omitempty"` StartNumber int32 `json:"start_number,omitempty"` Limit int32 `json:"limit,omitempty"` ScalingConfigurations []Configuration `json:"scaling_configurations,omitempty"` }
func List ¶
func List(client *golangsdk.ServiceClient, opts ListOpts) (*ListScalingConfigsResponse, error)
type Personality ¶
type Personality struct { // Specifies the path of the injected file. // For Linux OSs, specify the path, for example, /etc/foo.txt, for storing the injected file. // For Windows, the injected file is automatically stored in the root directory of drive C. // You only need to specify the file name, for example, foo. The file name contains only letters and digits. Path string `json:"path"` // Specifies the content of the injected file. // The value must be the information after the content of the injected file is encoded using Base64. Content string `json:"content"` }
type PublicIp ¶
type PublicIp struct { // Specifies the EIP automatically assigned to the ECS. Eip Eip `json:"eip,omitempty"` }
type SecurityGroup ¶ added in v0.2.7
type SecurityGroup struct { // Specifies the ID of the security group. ID string `json:"id"` }
Click to show internal directories.
Click to hide internal directories.