Documentation ¶
Index ¶
- func CreateURL(c *gophercloud.ServiceClient) string
- func DeleteURL(c *gophercloud.ServiceClient, scalingGroupId string) string
- func EnableURL(c *gophercloud.ServiceClient, scalingGroupId string) string
- func GetURL(c *gophercloud.ServiceClient, scalingGroupId string) string
- func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func ListURL(c *gophercloud.ServiceClient) string
- func UpdateURL(c *gophercloud.ServiceClient, scalingGroupId string) string
- type CreateOpts
- type CreateOptsBuilder
- type CreateResponse
- type CreateResult
- type DeleteOpts
- type DeleteOptsBuilder
- type DeleteResult
- type EnableOpts
- type EnableOptsBuilder
- type EnableResponse
- type EnableResult
- type GetResponse
- type GetResult
- type GroupPage
- type LBaasListener
- type LbListener
- type ListOpts
- type ListOptsBuilder
- type ListResponse
- type Network
- type ScalingGroup
- type SecurityGroup
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResponse
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateURL ¶
func CreateURL(c *gophercloud.ServiceClient) string
func DeleteURL ¶
func DeleteURL(c *gophercloud.ServiceClient, scalingGroupId string) string
func EnableURL ¶
func EnableURL(c *gophercloud.ServiceClient, scalingGroupId string) string
func GetURL ¶
func GetURL(c *gophercloud.ServiceClient, scalingGroupId string) string
func List ¶
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
func ListURL ¶
func ListURL(c *gophercloud.ServiceClient) string
func UpdateURL ¶
func UpdateURL(c *gophercloud.ServiceClient, scalingGroupId string) string
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Specifies the AS group name. The name can contain letters, // digits, underscores (_), and hyphens (-), and cannot exceed 64 characters. ScalingGroupName string `json:"scaling_group_name" required:"true"` // Specifies the AS configuration ID. You can obtain its value // from the API used to query AS configurations. For details, see Querying AS // Configurations.https://support.huaweicloud.com/en-us/api-as/en-us_topic_0043063056.ht // ml ScalingConfigurationId string `json:"scaling_configuration_id,omitempty"` // Specifies the expected number of instances. The default value // is the minimum number of instances.The value ranges from the minimum number of // instances to the maximum number of instances. DesireInstanceNumber *int `json:"desire_instance_number,omitempty"` // Specifies the minimum number of instances. The default value is // 0. MinInstanceNumber *int `json:"min_instance_number,omitempty"` // Specifies the maximum number of instances. The default value is // 0. MaxInstanceNumber *int `json:"max_instance_number,omitempty"` // Specifies the cooling duration (in seconds). The value ranges // from 0 to 86400, and is 900 by default.The cooling duration takes effect only for // scaling actions triggered by alarms. Scaling actions executed manually as well as // those scheduled to trigger periodically or at a particular time will not be // affected. CoolDownTime *int `json:"cool_down_time,omitempty"` // Specifies the ID of a typical ELB listener. The system supports // the binding of up to three ELB listeners, the IDs of which are separated using a // comma (,). You can use vpc_id to obtain a load balancer ID from the API used to query // an ELB list. For details, see section "Querying Load Balancers" in the Elastic Load // Balance API Reference. Then, use the load balancer ID to query the ELB listener list // to obtain the ELB listener ID. For details, see section "Querying Listeners" in the // Elastic Load Balance API Reference. LbListenerId string `json:"lb_listener_id,omitempty"` // Specifies the AZ information. The ECS associated with the // scaling action will be created in the specified AZ. If you do not specify an AZ, the // system automatically specifies one.For details, see section Regions and // Endpoints.https://developer.huaweicloud.com/endpoint AvailableZones []string `json:"available_zones,omitempty"` // Specifies network information. The system supports up to five // subnets. The first subnet transferred serves as the primary NIC of the ECS by // default. You can use vpc_id to obtain the parameter value from the API used to query // VPC subnets. For details, see section Subnet > Querying Subnets in the Virtual // Private Cloud API Reference. Networks []Network `json:"networks" required:"true"` // Specifies security group information. You can use vpc_id to // obtain the parameter value from the API used to query VPC security groups. For // details, see section "Querying Security Groups" in the Virtual Private Cloud API // Reference. SecurityGroups []SecurityGroup `json:"security_groups,omitempty"` // Specifies the VPC information. You can obtain its value from // the API used to query VPCs. For details, see section "Querying VPCs" in the Virtual // Private Cloud API Reference. VpcId string `json:"vpc_id" required:"true"` // Specifies the health check method for instances in the AS // group. The health check methods include ELB_AUDIT and NOVA_AUDIT. If load balancing // is configured, the default value of this parameter is ELB_AUDIT. Otherwise, the // default value is NOVA_AUDIT.ELB_AUDIT refers to the ELB health check, which takes // effect in an AS group that has a listener.NOVA_AUDIT refers to the health check // delivered with AS. HealthPeriodicAuditMethod string `json:"health_periodic_audit_method,omitempty"` // Specifies the health check period for instances. The period has // four options: 5 minutes (default), 15 minutes, 60 minutes, and 180 minutes. HealthPeriodicAuditTime *int `json:"health_periodic_audit_time,omitempty"` // Specifies the health check interval. HealthPeriodicAuditTimeGracePeriod *int `json:"health_periodic_audit_grace_period,omitempty"` // Specifies the instance removal policy.(Default) // OLD_CONFIG_OLD_INSTANCE: The earlier-created instances that were selected from the // instances created based on earlier-created configurations are removed // first.OLD_CONFIG_NEW_INSTANCE: The later-created instances that were selected from // the instances created based on earlier-created configurations are removed // first.OLD_INSTANCE: The earlier-created instances are removed first.NEW_INSTANCE: The // later-created instances are removed first. InstanceTerminatePolicy string `json:"instance_terminate_policy,omitempty"` // Specifies the notification mode.EMAIL refers to notification by // email.This notification mode is going to be canceled. You are advised to configure // the notification function for the AS group. See Notifications for // details.https://support.huaweicloud.com/en-us/api-as/en-us_topic_0043063034.html Notifications []string `json:"notifications,omitempty"` // Specifies whether to delete the EIP bound to the ECS when // deleting the ECS. If you do not want to delete the EIP, set this parameter to false. // Then, the system only unbinds the EIP from the ECS and reserves the EIP.The value can // be true or false. The default value is false.true: deletes the EIP bound to the ECS // when deleting the ECS. When the ECS is charged in Yearly/Monthly mode, the EIP bound // to the ECS will not be deleted when the ECS is deleted.false: only unbinds the EIP // bound to the ECS when deleting the ECS DeletePublicip *bool `json:"delete_publicip,omitempty"` LBaasListeners []LBaasListener `json:"lbaas_listeners,omitempty"` EnterpriseProjectID string `json:"enterprise_project_id,omitempty"` }
func (CreateOpts) ToGroupsCreateMap ¶
func (opts CreateOpts) ToGroupsCreateMap() (map[string]interface{}, error)
type CreateOptsBuilder ¶
type CreateResponse ¶
type CreateResponse struct { // Specifies the AS group ID. ScalingGroupId string `json:"scaling_group_id"` }
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
func Create ¶
func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*CreateResponse, error)
type DeleteOpts ¶
type DeleteOpts struct { // Specifies whether to forcibly delete an AS group. The value can // be yes or no(default). ForceDelete string `q:"force_delete"` }
func (DeleteOpts) ToDeleteQuery ¶
func (opts DeleteOpts) ToDeleteQuery() (string, error)
type DeleteOptsBuilder ¶
type DeleteResult ¶
type DeleteResult struct {
gophercloud.ErrResult
}
func Delete ¶
func Delete(client *gophercloud.ServiceClient, scalingGroupId string, opts DeleteOptsBuilder) (r DeleteResult)
type EnableOpts ¶
type EnableOpts struct { // Specifies a flag for enabling or disabling an AS group.resume: // enables the AS group.pause: disables the AS group. Action string `json:"action" required:"true"` }
func (EnableOpts) ToGroupsEnableMap ¶
func (opts EnableOpts) ToGroupsEnableMap() (map[string]interface{}, error)
type EnableOptsBuilder ¶
type EnableResponse ¶
type EnableResponse struct { }
type EnableResult ¶
type EnableResult struct {
// contains filtered or unexported fields
}
func Enable ¶
func Enable(client *gophercloud.ServiceClient, scalingGroupId string, opts EnableOptsBuilder) (r EnableResult)
func (EnableResult) Extract ¶
func (r EnableResult) Extract() (*EnableResponse, error)
type GetResponse ¶
type GetResponse struct { // Specifies details about the AS group. ScalingGroup ScalingGroup `json:"scaling_group"` }
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
func Get ¶
func Get(client *gophercloud.ServiceClient, scalingGroupId string) (r GetResult)
func (GetResult) Extract ¶
func (r GetResult) Extract() (*ScalingGroup, error)
type GroupPage ¶
type GroupPage struct {
pagination.NumberPageBase
}
func (GroupPage) LastStartNumber ¶
LastStartNumber returns the last service in a ListResult.
type LBaasListener ¶
type LbListener ¶
type ListOpts ¶
type ListOpts struct { // Specifies the AS group name. ScalingGroupName string `q:"scaling_group_name"` // Specifies the AS configuration ID. You can obtain its value // from the API used to query AS configurations. For details, see Querying AS // Configurations.https://support.huaweicloud.com/en-us/api-as/en-us_topic_0043063056.ht // ml ScalingConfigurationId string `q:"scaling_configuration_id"` // Specifies the AS group status. The value can be INSERVICE, // PAUSED, ERROR, or DELETING. ScalingGroupStatus string `q:"scaling_group_status"` // Specifies the start line number. The default value is 0. StartNumber int `q:"start_number"` // Specifies the number of query records. The default value is // 20. Limit int `q:"limit"` EnterpriseProjectID string `q:"enterprise_project_id"` }
func (ListOpts) ToListQuery ¶
type ListOptsBuilder ¶
type ListResponse ¶
type ListResponse struct { // Specifies the total number of query records. TotalNumber int `json:"total_number"` // Specifies the start number of query records. StartNumber int `json:"start_number"` // Specifies the number of query records. Limit int `json:"limit"` // Specifies the scaling group list. ScalingGroups []ScalingGroup `json:"scaling_groups"` }
func ExtractGroups ¶
func ExtractGroups(r pagination.Page) (ListResponse, error)
ExtractGroups is a function that takes a ListResult and returns the information.
type Network ¶
type Network struct { // Specifies the network ID. ID string `json:"id" required:"true"` Ipv6Enable *bool `json:"ipv6_enable,omitempty"` Ipv6Bandwidth *SecurityGroup `json:"ipv6_bandwidth,omitempty"` }
type ScalingGroup ¶
type ScalingGroup struct { // Specifies the name of the AS group. ScalingGroupName string `json:"scaling_group_name"` // Specifies the AS group ID. ScalingGroupId string `json:"scaling_group_id"` // Specifies the status of the AS group. ScalingGroupStatus string `json:"scaling_group_status"` // Specifies the AS configuration ID. ScalingConfigurationId string `json:"scaling_configuration_id"` // Specifies the AS configuration name. ScalingConfigurationName string `json:"scaling_configuration_name"` // Specifies the number of current instances in the AS group. CurrentInstanceNumber int `json:"current_instance_number"` // Specifies the expected number of instances in the AS group. DesireInstanceNumber int `json:"desire_instance_number"` // Specifies the minimum number of instances in the AS group. MinInstanceNumber int `json:"min_instance_number"` // Specifies the maximum number of instances in the AS group. MaxInstanceNumber int `json:"max_instance_number"` // Specifies the cooling duration (s). CoolDownTime int `json:"cool_down_time"` // Specifies the ID of a typical ELB listener. ELB listener IDs // are separated using a comma (,). LbListenerId string `json:"lb_listener_id"` // This field is reserved. LbaasListeners []LbListener `json:"lbaas_listeners"` // Specifies the AZ information. AvailableZones []string `json:"available_zones"` // Specifies network information. Networks []Network `json:"networks"` // Specifies security group information. SecurityGroups []SecurityGroup `json:"security_groups"` // Specifies the time when an AS group was created. The time // format complies with UTC. CreateTime string `json:"create_time"` // Specifies the ID of the VPC to which the AS group belongs. VpcId string `json:"vpc_id"` // Specifies details about the AS group. Detail string `json:"detail"` // Specifies the scaling flag of the AS group. IsScaling bool `json:"is_scaling"` // Specifies the health check method. HealthPeriodicAuditMethod string `json:"health_periodic_audit_method"` // Specifies the health check interval. HealthPeriodicAuditTime int `json:"health_periodic_audit_time"` // Specifies the health check interval. HealthPeriodicAuditTimeGracePeriod int `json:"health_periodic_audit_grace_period"` // Specifies the instance removal policy. InstanceTerminatePolicy string `json:"instance_terminate_policy"` // Specifies the notification mode. Notifications []string `json:"notifications"` // Specifies whether to delete the EIP bound to the ECS when // deleting the ECS. DeletePublicip bool `json:"delete_publicip"` // This field is reserved. CloudLocationId string `json:"cloud_location_id"` EnterpriseProjectID string `json:"enterprise_project_id"` ActivityType string `json:"activity_type"` }
type SecurityGroup ¶
type SecurityGroup struct { // Specifies the ID of the security group. ID string `json:"id" required:"true"` }
type UpdateOpts ¶
type UpdateOpts struct { // Specifies the AS group name. The name can contain letters, // digits, underscores (_), and hyphens (-), and cannot exceed 64 characters. ScalingGroupName string `json:"scaling_group_name,omitempty"` // Specifies the expected number of instances.The value ranges // from the minimum number of instances to the maximum number of instances. DesireInstanceNumber *int `json:"desire_instance_number,omitempty"` // Specifies the minimum number of instances. MinInstanceNumber *int `json:"min_instance_number,omitempty"` // Specifies the maximum number of instances, which is greater // than or equal to the minimum number of instances. MaxInstanceNumber *int `json:"max_instance_number,omitempty"` // Specifies the cooling duration (in seconds). The value ranges // from 0 to 86400. CoolDownTime *int `json:"cool_down_time,omitempty"` // Specifies the AZ information. The ECS associated with the // scaling action will be created in the specified AZ. If you do not specify an AZ, the // system automatically specifies one.For details, see section Regions and Endpoints.The // value of this parameter can be changed only when all the following conditions are // met:No scaling actions are triggered in the AS group.The number of instances in the // AS group is 0.The AS group is not in service. AvailableZones []string `json:"available_zones,omitempty"` // Specifies network information. The system supports up to five // subnets. The first subnet transferred serves as the primary NIC of the ECS by // default. You can use vpc_id to obtain the parameter value from the API used to query // VPC subnets. For details, see section Subnet > Querying Subnets in the Virtual // Private Cloud API Reference. The value of this parameter can be changed only when all // the following conditions are met:No scaling actions are triggered in the AS group.The // number of instances in the AS group is 0.The AS group is not in service. Networks []Network `json:"networks,omitempty"` // Specifies security group information. You can use vpc_id to // obtain the parameter value from the API used to query VPC security groups. For // details, see section "Querying Security Groups" in the Virtual Private Cloud API // Reference.The value of this parameter can be changed only when all the following // conditions are met:No scaling actions are triggered in the AS group.The number of // instances in the AS group is 0.The AS group is not in service. SecurityGroups []SecurityGroup `json:"security_groups,omitempty"` // Specifies the ID of a typical ELB listener. The system supports // the binding of up to three ELB listeners, the IDs of which are separated using a // comma (,). You can use vpc_id to obtain a load balancer ID from the API used to query // an ELB list. For details, see section "Querying Load Balancers" in the Elastic Load // Balance API Reference. Then, use the load balancer ID to query the ELB listener list // to obtain the ELB listener ID. For details, see section "Querying Listeners" in the // Elastic Load Balance API Reference.The value of this parameter can be changed only // when all the following conditions are met:No scaling actions are triggered in the AS // group.The number of instances in the AS group is 0.The AS group is not in service. LbListenerId string `json:"lb_listener_id,omitempty"` // Specifies the health check method for instances in the AS // group. The health check methods include ELB_AUDIT and NOVA_AUDIT.ELB_AUDIT refers to // the ELB health check, which takes effect in an AS group that has a // listener.NOVA_AUDIT refers to the health check delivered with AS. HealthPeriodicAuditMethod string `json:"health_periodic_audit_method,omitempty"` // Specifies the health check period for the instances in the AS // group. The value can be 5 minutes, 15 minutes, 60 minutes, or 180 minutes. HealthPeriodicAuditTime *int `json:"health_periodic_audit_time,omitempty"` // Specifies the instance removal policy.(Default) // OLD_CONFIG_OLD_INSTANCE: The earlier-created instances that were selected from the // instances created based on earlier-created configurations are removed // first.OLD_CONFIG_NEW_INSTANCE: The later-created instances that were selected from // the instances created based on earlier-created configurations are removed // first.OLD_INSTANCE: The earlier-created instances are removed first.NEW_INSTANCE: The // later-created instances are removed first. InstanceTerminatePolicy string `json:"instance_terminate_policy,omitempty"` // Specifies the AS configuration ID. You can obtain its value // from the API used to query AS configurations. For details, see Querying AS // Configurations.https://support.huaweicloud.com/en-us/api-as/en-us_topic_0043063056.ht // ml ScalingConfigurationId string `json:"scaling_configuration_id,omitempty"` // Specifies the notification mode.EMAIL refers to notification by // email.This notification mode is going to be canceled. You are advised to configure // the notification function for the AS group. See Notifications for // details.https://support.huaweicloud.com/en-us/api-as/en-us_topic_0043063034.html Notifications []string `json:"notifications,omitempty"` // Specifies whether to delete the EIP bound to the ECS when // deleting the ECS. If you do not want to delete the EIP, set this parameter to false. // Then, the system only unbinds the EIP from the ECS and reserves the EIP.The value can // be true or false. The default value is false.true: deletes the EIP bound to the ECS // when deleting the ECS. When the ECS is charged in Yearly/Monthly mode, the EIP bound // to the ECS will not be deleted when the ECS is deleted.false: only unbinds the EIP // bound to the ECS when deleting the ECS DeletePublicip *bool `json:"delete_publicip,omitempty"` LBaasListeners []LBaasListener `json:"lbaas_listeners,omitempty"` EnterpriseProjectID string `json:"enterprise_project_id,omitempty"` }
func (UpdateOpts) ToGroupsUpdateMap ¶
func (opts UpdateOpts) ToGroupsUpdateMap() (map[string]interface{}, error)
type UpdateOptsBuilder ¶
type UpdateResponse ¶
type UpdateResponse struct { // Specifies the AS group ID. ScalingGroupId string `json:"scaling_group_id"` }
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
func Update ¶
func Update(client *gophercloud.ServiceClient, scalingGroupId string, opts UpdateOptsBuilder) (r UpdateResult)
func (UpdateResult) Extract ¶
func (r UpdateResult) Extract() (*UpdateResponse, error)
Click to show internal directories.
Click to hide internal directories.