Documentation ¶
Overview ¶
Package progress implements API functions residing under /provisioning/progress. This path contains methods for querying the status of VM provisioning tasks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrProgress = errors.New("progress response contains errors")
ErrProgress is raised if a poll request completes but the result contains errors.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { AwaitCompletion(ctx context.Context, progressID string) (string, error) Get(ctx context.Context, identifier string) (Progress, error) }
API contains methods for progress inquiries.
type Progress ¶
type Progress struct { // TaskIdentifier is the identifier of the provisioning task. TaskIdentifier string `json:"identifier"` // Queued indicates that the task is waiting to be started. Queued bool `json:"queued"` // Progress is the provisioning progress in percent (queuing not included). Progress int `json:"progress"` // VMIdentifier of the new VM. VMIdentifier string `json:"vm_identifier"` // Errors encountered while provisioning. Errors []string `json:"errors"` // Status of the task. Status Status `json:"status"` }
Progress contains information regarding the provisioning of a VM returned by the API .
type Status ¶ added in v0.7.4
type Status string
const ( // StatusFailed indicates that the progress failed. StatusFailed Status = "-1" // StatusSuccess indicates that the progress succeeded. StatusSuccess Status = "1" // StatusInProgress indicates that the progress is still ongoing. StatusInProgress Status = "2" // StatusCancelled indicates that the progress has been cancelled. StatusCancelled Status = "3" )
Click to show internal directories.
Click to hide internal directories.