progress

package
v0.7.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

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.

func NewAPI

func NewAPI(c client.Client) API

NewAPI creates a new progress API instance with the given client.

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"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL