imagetransfer

package
v0.0.0-...-9fc8b42 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: UPL-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ActionCancel string = "cancel"
View Source
const ActionFinalize string = "finalize"
View Source
const DirectionUpload string = "upload"
View Source
const FormatCow = "cow"
View Source
const PhaseCancelled string = "cancelled"
View Source
const PhaseFinished string = "finished_success"
View Source
const PhaseTransferring string = "transferring"

See https://www.ovirt.org/documentation/doc-REST_API_Guide/#types-image_transfer_phase

View Source
const TimeoutPolicy string = "cancel"

see https://www.ovirt.org/documentation/doc-REST_API_Guide/#types-image_transfer_timeout_policy cancel the transfer and unlock the disk

Variables

This section is empty.

Functions

func DeleteImageTransfer

func DeleteImageTransfer(ovcli *ovclient.Client, transferID string) error

DeleteImageTransfer deletes an imagetransfer resource.

func DoImageTransferAction

func DoImageTransferAction(ovcli *ovclient.Client, transferID string, action string) error

DoImageTransferAction post an action to the image transfer resource

func UploadFile

func UploadFile(ovcli *ovclient.Client, inUrl string, reader io.Reader, totalLen int64) error

UploadFile uploads an image to an endpoint

Types

type CreateImageTransferRequest

type CreateImageTransferRequest struct {
	Name              string `json:"name"`
	Disk              `json:"disk"`
	Direction         string `json:"direction"`
	TimeoutPolicy     string `json:"timeout_policy"`
	Format            string `json:"format"`
	InactivityTimeout string `json:"inactivity_timeout"`
}

CreateImageTransferRequest specifies the request to the image transfer service

type Disk

type Disk struct {
	Id string `json:"id"`
}

type ImageTransfer

type ImageTransfer struct {
	Active            string `json:"active"`
	Direction         string `json:"direction"`
	Format            string `json:"format"`
	InactivityTimeout string `json:"inactivity_timeout"`
	Phase             string `json:"phase"`
	ProxyUrl          string `json:"proxy_url"`
	Shallow           string `json:"shallow"`
	TimeoutPolicy     string `json:"timeout_policy"`
	TransferUrl       string `json:"transfer_url"`
	Transferred       string `json:"transferred"`
	Host              struct {
		Href string `json:"href"`
		Id   string `json:"id"`
	} `json:"host"`
	Image struct {
		Id string `json:"id"`
	} `json:"image"`
	Actions struct {
		Link []struct {
			Href string `json:"href"`
			Rel  string `json:"rel"`
		} `json:"link"`
	} `json:"actions"`
	Href string `json:"href"`
	Id   string `json:"id"`
}

func CreateImageTransfer

func CreateImageTransfer(ovcli *ovclient.Client, req *CreateImageTransferRequest) (*ImageTransfer, error)

CreateImageTransferRequest creates an image transfer resource needed to upload an image to a disk

func GetImageTransfer

func GetImageTransfer(ovcli *ovclient.Client, transferID string) (*ImageTransfer, error)

GetImageTransfer gets an imagetransfer resource.

type ImageTransferList

type ImageTransferList struct {
	ImageTransfers []struct {
		ImageTransfer
	} `json:"image_transfer"`
}

Jump to

Keyboard shortcuts

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