Documentation
¶
Index ¶
- func Create(c *golangsdk.ServiceClient, groupID string, opts CreateOpts) (string, error)
- func Delete(client *golangsdk.ServiceClient, groupID, taskID string) error
- func Update(c *golangsdk.ServiceClient, groupID, taskID string, opts UpdateOpts) error
- type CreateOpts
- type InstanceNumber
- type ListOpts
- type ScheduledPolicy
- type ScheduledTask
- type ScheduledTaskPage
- type UpdateOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(c *golangsdk.ServiceClient, groupID string, opts CreateOpts) (string, error)
Create is a method used to create planned task using given parameters.
func Delete ¶
func Delete(client *golangsdk.ServiceClient, groupID, taskID string) error
Delete is a method used to delete planned task using given parameters.
func Update ¶
func Update(c *golangsdk.ServiceClient, groupID, taskID string, opts UpdateOpts) error
Update is a method used to update planned task using given parameters.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // The name of planned task to be created. Name string `json:"name" required:"true"` // The policy of planned task to be created. ScheduledPolicy ScheduledPolicy `json:"scheduled_policy" required:"true"` // The numbers of scaling group instance for planned task to be created. InstanceNumber InstanceNumber `json:"instance_number" required:"true"` }
CreateOpts is the structure that used to create planned task.
type InstanceNumber ¶
type InstanceNumber struct { // The max number of instances of the scaling group to which the planned task belongs. Max *int `json:"max,omitempty"` // The min number of instances of the scaling group to which the planned task belongs. Min *int `json:"min,omitempty"` // The desire number of instances of the scaling group to which the planned task belongs. Desire *int `json:"desire,omitempty"` }
InstanceNumber is the structure that used to create the numbers of scaling group instance for planned task.
type ListOpts ¶
type ListOpts struct { // The ID of scaling group. GroupID string `q:"scaling_group_id"` // Number of records displayed per page. // The value must be a positive integer. Limit int `q:"limit"` // The ID of the last record displayed on the previous page. Marker string `q:"marker"` }
ListOpts is the structure that used to query the planned tasks.
type ScheduledPolicy ¶
type ScheduledPolicy struct { // The execution time of the planned task. LaunchTime string `json:"launch_time" required:"true"` // The type of the planned task. RecurrenceType string `json:"recurrence_type,omitempty"` // The specific date when the planned task is executed according to the cycle. RecurrenceValue string `json:"recurrence_value,omitempty"` // The effective start time of the planned task. StartTime string `json:"start_time,omitempty"` // The effective end time of the planned task. EndTime string `json:"end_time,omitempty"` }
ScheduledPolicy is the structure that used to create the policy of planned task.
type ScheduledTask ¶
type ScheduledTask struct { // The ID of created planned task. ID string `json:"task_id"` // The ID of scaling group. GroupID string `json:"scaling_group_id"` // The name of created planned task. Name string `json:"name"` // The policy of created planned task. ScheduledPolicy ScheduledPolicy `json:"scheduled_policy"` // The numbers of scaling group instance of created planned task. InstanceNumber InstanceNumber `json:"instance_number"` // The creation time of planned task. CreateTime string `json:"create_time"` // The ID of the tenant to which this planned task belongs. TenantID string `json:"tenant_id"` // The ID of the domain to which this planned task belongs. DomainID string `json:"domain_id"` }
ScheduledTask is the structure that represents the planned task detail.
func ExtractScheduledTasks ¶
func ExtractScheduledTasks(r pagination.Page) ([]ScheduledTask, error)
ExtractScheduledTasks is a method to extract the list of planned task details.
func List ¶
func List(c *golangsdk.ServiceClient, opts ListOpts) ([]ScheduledTask, error)
List is a method used to query the planned tasks with given parameters.
type ScheduledTaskPage ¶
type ScheduledTaskPage struct {
pagination.MarkerPageBase
}
ScheduledTaskPage represents the response pages of the List method.
func (ScheduledTaskPage) IsEmpty ¶
func (r ScheduledTaskPage) IsEmpty() (bool, error)
IsEmpty method checks whether the current planned task page is empty.
func (ScheduledTaskPage) LastMarker ¶
func (p ScheduledTaskPage) LastMarker() (string, error)
LastMarker method returns the last planned task ID in a planned task page.
type UpdateOpts ¶
type UpdateOpts struct { // The name of planned task to be updated. Name string `json:"name,omitempty"` // The policy of planned task to be updated. ScheduledPolicy *ScheduledPolicy `json:"scheduled_policy,omitempty"` // The numbers of scaling group instance for planned task to be updated. InstanceNumber *InstanceNumber `json:"instance_number,omitempty"` }
UpdateOpts is the structure that used to update the planned task.