progress

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 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 indicated 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"`
}

Progress contains information regarding the provisioning of a VM returned by the API .

Jump to

Keyboard shortcuts

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