Documentation ¶
Index ¶
- Constants
- func ExtractTasksInto(r pagination.Page, v interface{}) error
- func List(c *edgecloud.ServiceClient) pagination.Pager
- func WaitForStatus(client *edgecloud.ServiceClient, id string, status TaskState, secs int, ...) error
- func WaitTaskAndProcessResult(client *edgecloud.ServiceClient, task TaskID, stopOnTaskError bool, ...) error
- func WaitTaskAndReturnResult(client *edgecloud.ServiceClient, task TaskID, stopOnTaskError bool, ...) (interface{}, error)
- type CheckTaskResult
- type CreateResult
- type DeleteResult
- type GetResult
- type Result
- type RetrieveTaskResult
- type Task
- type TaskID
- type TaskPage
- type TaskResults
- type TaskState
- type Tasks
- type UpdateResult
Constants ¶
const ( TaskStateNew = TaskState("NEW") TaskStateRunning = TaskState("RUNNING") TaskStateFinished = TaskState("FINISHED") TaskStateError = TaskState("ERROR") )
Variables ¶
This section is empty.
Functions ¶
func ExtractTasksInto ¶
func ExtractTasksInto(r pagination.Page, v interface{}) error
func List ¶
func List(c *edgecloud.ServiceClient) pagination.Pager
List returns a Pager which allows you to iterate over a collection of cluster templates. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
func WaitForStatus ¶
func WaitForStatus(client *edgecloud.ServiceClient, id string, status TaskState, secs int, stopOnTaskError bool) error
WaitForStatus will continually poll the task resource, checking for a particular status. It will do this for the amount of seconds defined.
func WaitTaskAndProcessResult ¶
func WaitTaskAndProcessResult(client *edgecloud.ServiceClient, task TaskID, stopOnTaskError bool, waitSeconds int, taskProcessor CheckTaskResult) error
WaitTaskAndProcessResult periodically check status state and invoke taskProcessor when task is finished.
func WaitTaskAndReturnResult ¶
func WaitTaskAndReturnResult(client *edgecloud.ServiceClient, task TaskID, stopOnTaskError bool, waitSeconds int, taskProcessor RetrieveTaskResult) (interface{}, error)
WaitTaskAndReturnResult periodically check status state and return changed object when task is finished.
Types ¶
type CheckTaskResult ¶
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult represents the result of a create operation. Call its Extract method to interpret it as a Network.
func (CreateResult) Extract ¶
Extract is a function that accepts a result and extracts a task resource.
func (CreateResult) ExtractInto ¶
func (r CreateResult) ExtractInto(v interface{}) error
type DeleteResult ¶
DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a Network.
func Get ¶
func Get(c *edgecloud.ServiceClient, id string) (r GetResult)
Get retrieves a specific cluster template based on its unique ID.
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts a task resource.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
type Result ¶
Result represents the operation result that returns tasks.
func (Result) Extract ¶
func (r Result) Extract() (*TaskResults, error)
Extract is a function that accepts a result and extracts a task resource.
type RetrieveTaskResult ¶
type Task ¶
type Task struct { ID string `json:"id"` TaskType string `json:"task_type"` ProjectID int `json:"project_id,omitempty"` ClientID int `json:"client_id"` RegionID *int `json:"region_id"` UserID int `json:"user_id"` UserClientID int `json:"user_client_id"` State TaskState `json:"state"` CreatedOn edgecloud.JSONRFC3339NoZ `json:"created_on"` UpdatedOn *edgecloud.JSONRFC3339NoZ `json:"updated_on"` FinishedOn *edgecloud.JSONRFC3339NoZ `json:"finished_on"` AcknowledgedAt *edgecloud.JSONRFC3339NoZ `json:"acknowledged_at"` AcknowledgedBy *int `json:"acknowledged_by"` CreatedResources *map[string]interface{} `json:"created_resources"` RequestID *string `json:"request_id"` Error *string `json:"error"` Data *map[string]interface{} `json:"data"` }
type TaskPage ¶
type TaskPage struct {
pagination.LinkedPageBase
}
TaskPage is the page returned by a pager when traversing over a collection of tasks.
func (TaskPage) NextPageURL ¶
NextPageURL is invoked when a paginated collection of cluster has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type TaskResults ¶
type TaskResults struct {
Tasks []TaskID `json:"tasks"`
}
type Tasks ¶
type Tasks []Task
func ExtractTasks ¶
func ExtractTasks(r pagination.Page) (Tasks, error)
ExtractTasks accepts a Page struct, specifically a ClusterPage struct, and extracts the elements into a slice of Task structs. In other words, a generic collection is mapped into a relevant slice.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a Network.
func (UpdateResult) Extract ¶
Extract is a function that accepts a result and extracts a task resource.
func (UpdateResult) ExtractInto ¶
func (r UpdateResult) ExtractInto(v interface{}) error