image

package
v1.6.0-alfa Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Lists all the images. A image is a template which can be used to deploy machines

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	// Explicit
	Explicit bool `json:"explicit"`

	// GUID
	GUID string `json:"guid"`

	// Right
	Right string `json:"right"`

	// Status
	Status string `json:"status"`

	// Type
	Type string `json:"type"`

	// User group ID
	UserGroupID string `json:"userGroupId"`
}

Access Control List

type ComputeCISetRequest

type ComputeCISetRequest struct {
	// ID of the image
	// Required: true
	ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`

	// ID of the compute CI
	// Required: true
	ComputeCIID uint64 `url:"computeciId" json:"computeciId" validate:"required"`
}

Request struct for set compute CI

type ComputeCIUnsetRequest

type ComputeCIUnsetRequest struct {
	// ID of the image
	// Required: true
	ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
}

Request struct for unset compute CI

type CreateCDROMImageRequest

type CreateCDROMImageRequest struct {
	// Name of the rescue disk
	// Required: true
	Name string `url:"name" json:"name" validate:"required"`

	// URL where to download ISO from
	// Required: true
	URL string `url:"url" json:"url" validate:"required,url"`

	// Grid (platform) ID where this CD-ROM image should be create in
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`

	// Account ID to make the image exclusive
	// Required: false
	AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`

	// Storage endpoint provider ID for place rescue CD
	// Required: false
	SEPID uint64 `url:"sep_id,omitempty" json:"sep_id,omitempty"`

	// Pool for place rescue CD
	// Required: false
	PoolName string `url:"pool_name,omitempty" json:"pool_name,omitempty"`

	// Username for remote media download
	// Required: false
	UsernameDL string `url:"usernameDL,omitempty" json:"usernameDL,omitempty"`

	// Password for remote media download
	// Required: false
	PasswordDl string `url:"passwordDL,omitempty" json:"passwordDL,omitempty"`

	// Binary architecture of this image
	// Should be one of:
	//	- X86_64
	//	- PPC64_LE
	// Required: false
	Architecture string `url:"architecture,omitempty" json:"architecture,omitempty"`

	// List of types of compute suitable for image.
	// Example: [ "KVM_X86" ]
	// Required: true
	Drivers []string `url:"drivers" json:"drivers" validate:"min=1,max=2,imageDrivers"`
}

Request struct for create CD-ROM image

type CreateRequest

type CreateRequest struct {
	// Name of the rescue disk
	// Required: true
	Name string `url:"name" json:"name" validate:"required"`

	// URL where to download media from
	// Required: true
	URL string `url:"url" json:"url" validate:"required,url"`

	// Grid (platform) ID where this template should be create in
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`

	// Boot type of image
	// Should be one of:
	//	- bios
	//	- UEFI
	// Required: true
	BootType string `url:"boottype" json:"boottype" validate:"imageBootType"`

	// Image type
	// Should be one of:
	//	- linux
	//	- windows
	//	- or other
	// Required: true
	ImageType string `url:"imagetype" json:"imagetype" validate:"imageType"`

	// Does this machine supports hot resize
	// Required: false
	HotResize bool `url:"hotresize,omitempty" json:"hotresize,omitempty"`

	// Optional username for the image
	// Required: false
	Username string `url:"username,omitempty" json:"username,omitempty"`

	// Optional password for the image
	// Required: false
	Password string `url:"password,omitempty" json:"password,omitempty"`

	// Account ID to make the image exclusive
	// Required: false
	AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`

	// Username for upload binary media
	// Required: false
	UsernameDL string `url:"usernameDL,omitempty" json:"usernameDL,omitempty"`

	// Password for upload binary media
	// Required: false
	PasswordDL string `url:"passwordDL,omitempty" json:"passwordDL,omitempty"`

	// Storage endpoint provider ID
	// Required: false
	SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`

	// Pool for image create
	// Required: false
	PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"`

	// Binary architecture of this image
	// Should be one of:
	//	- X86_64
	//	- PPC64_LE
	// Required: false
	Architecture string `url:"architecture,omitempty" json:"architecture,omitempty"`

	// List of types of compute suitable for image
	// Example: [ "KVM_X86" ]
	// Required: true
	Drivers []string `url:"drivers" json:"drivers" validate:"min=1,max=2,imageDrivers"`

	// Bootable image or not
	// Required: false
	Bootable bool `url:"bootable,omitempty" json:"bootable,omitempty"`
}

Request struct for create image

type CreateVirtualRequest

type CreateVirtualRequest struct {
	// Name of the virtual image to create
	// Required: true
	Name string `url:"name" json:"name" validate:"required"`

	// ID of real image to link this virtual image to upon creation
	// Required: true
	TargetID uint64 `url:"targetId" json:"targetId" validate:"required"`
}

Request struct for create virtual image

type DeleteCDROMImageRequest

type DeleteCDROMImageRequest struct {
	// ID of the CD-ROM image to delete
	// Required: true
	ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`

	// Whether to completely delete the CD-ROM image, needs to be unused
	// Required: false
	Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
}

Request struct for delete CD-ROM image

type DeleteImagesRequest

type DeleteImagesRequest struct {
	// List of images to be deleted
	// Required: true
	ImageIDs []uint64 `url:"imageIds" json:"imageIds" validate:"min=1"`

	// Reason for action
	// Required: false
	Reason string `url:"reason,omitempty" json:"reason,omitempty"`

	// Whether to completely delete the images
	// Required: false
	Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
}

Request struct for delete images

type DeleteRequest

type DeleteRequest struct {
	// ID of the image to delete
	// Required: true
	ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`

	// Reason for action
	// Required: true
	Reason string `url:"reason,omitempty" json:"reason,omitempty"`

	// Whether to completely delete the image
	// Required: false
	Permanently bool `url:"permanently" json:"permanently"`
}

Request struct for delete image

type DisableRequest

type DisableRequest struct {
	// ID of image to be disabled
	// Required: true
	ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
}

Request struct for disable image

type EditRequest

type EditRequest struct {
	// ID of the image to edit
	// Required: true
	ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`

	// Name for the image
	// Required: false
	Name string `url:"name,omitempty" json:"name,omitempty"`

	// Username for the image
	// Required: false
	Username string `url:"username,omitempty" json:"username,omitempty"`

	// Password for the image
	// Required: false
	Password string `url:"password,omitempty" json:"password,omitempty"`

	// Account ID to make the image exclusive
	// Required: false
	AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`

	// Does this machine supports hot resize
	// Required: false
	HotResize bool `url:"hotresize,omitempty" json:"hotresize,omitempty"`

	// Does this image boot OS
	// Required: false
	Bootable bool `url:"bootable,omitempty" json:"bootable,omitempty"`
}

Request struct for edit image

type EnableRequest

type EnableRequest struct {
	// ID of image to be enabled
	// Required: true
	ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
}

Request struct for enable image

type GUID added in v1.5.4

type GUID string

func (*GUID) UnmarshalJSON added in v1.5.4

func (r *GUID) UnmarshalJSON(b []byte) error

type GetRequest

type GetRequest struct {
	// ID of image
	// Required: true
	ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
}

Request struct for get image details

type History

type History struct {
	// GUID
	GUID GUID `json:"guid"`

	// ID
	ID uint64 `json:"id"`

	// Timestamp
	Timestamp uint64 `json:"timestamp"`
}

History information

type Image

type Image struct {
	// contains filtered or unexported fields
}

Structure for creating request to image

func New

func New(client interfaces.Caller) *Image

Builder for image endpoint

func (Image) ComputeCISet

func (i Image) ComputeCISet(ctx context.Context, req ComputeCISetRequest) (bool, error)

ComputeCISet set compute CI ID for image

func (Image) ComputeCIUnset

func (i Image) ComputeCIUnset(ctx context.Context, req ComputeCIUnsetRequest) (bool, error)

ComputeCIUnset unset compute CI ID from image

func (Image) CreateCDROMImage

func (i Image) CreateCDROMImage(ctx context.Context, req CreateCDROMImageRequest) (uint64, error)

CreateCDROMImage creates CD-ROM image from an ISO identified by URL

func (Image) CreateImage

func (i Image) CreateImage(ctx context.Context, req CreateRequest) (uint64, error)

CreateImage creates image from a media identified by URL

func (Image) CreateVirtual

func (i Image) CreateVirtual(ctx context.Context, req CreateVirtualRequest) (uint64, error)

CreateVirtual creates virtual image

func (Image) Delete

func (i Image) Delete(ctx context.Context, req DeleteRequest) (bool, error)

Delete deletes image by ID

func (Image) DeleteCDROMImage

func (i Image) DeleteCDROMImage(ctx context.Context, req DeleteCDROMImageRequest) (bool, error)

DeleteCDROMImage delete a CD-ROM image

func (Image) DeleteImages

func (i Image) DeleteImages(ctx context.Context, req DeleteImagesRequest) (bool, error)

DeleteImages deletes images

func (Image) Disable

func (i Image) Disable(ctx context.Context, req DisableRequest) (bool, error)

Disable disables image

func (Image) Edit

func (i Image) Edit(ctx context.Context, req EditRequest) (bool, error)

Edit edits an existing image

func (Image) Enable

func (i Image) Enable(ctx context.Context, req EnableRequest) (bool, error)

Enable enables image

func (Image) Get

func (i Image) Get(ctx context.Context, req GetRequest) (*RecordImage, error)

Get get image details by ID

func (i Image) Link(ctx context.Context, req LinkRequest) (bool, error)

Link links virtual image to another image in the platform

func (Image) List

func (i Image) List(ctx context.Context, req ListRequest) (*ListImages, error)

List gets list of information about images

func (Image) ListStacks

func (i Image) ListStacks(ctx context.Context, req ListStacksRequest) (*ListStacks, error)

ListStacks gets list stack by image ID

func (Image) Rename

func (i Image) Rename(ctx context.Context, req RenameRequest) (bool, error)

Rename renames image by ID

func (Image) Share

func (i Image) Share(ctx context.Context, req ShareRequest) (bool, error)

Share shares image with accounts

func (Image) SyncCreate

func (i Image) SyncCreate(ctx context.Context, req SyncCreateRequest) (uint64, error)

SyncCreate creates image from a media identified by URL (in synchronous mode)

func (Image) UpdateNodes

func (i Image) UpdateNodes(ctx context.Context, req UpdateNodesRequest) (bool, error)

UpdateNodes udates image availability on nodes

type LinkRequest

type LinkRequest struct {
	// ID of the virtual image
	// Required: true
	ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`

	// ID of real image to link this virtual image to
	// Required: true
	TargetID uint64 `url:"targetId" json:"targetId" validate:"required"`
}

Request struct for link virtual image to another image

type ListACL

type ListACL []ACL

List ACL

type ListHistory

type ListHistory []History

List history

type ListImages

type ListImages struct {
	// Data
	Data []RecordImage `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

List images

func (ListImages) FilterByBootType

func (li ListImages) FilterByBootType(bootType string) ListImages

FilterByBootType returns ListImages with specified BootType.

func (ListImages) FilterByID

func (li ListImages) FilterByID(id uint64) ListImages

FilterById returns ListImages with specified ID.

func (ListImages) FilterByName

func (li ListImages) FilterByName(name string) ListImages

FilterByName returns ListImages with specified Name.

func (ListImages) FilterByStatus

func (li ListImages) FilterByStatus(status string) ListImages

FilterByStatus returns ListImages with specified Status.

func (ListImages) FilterByTechStatus

func (li ListImages) FilterByTechStatus(techStatus string) ListImages

FilterByTechStatus returns ListImages with specified TechStatus.

func (ListImages) FilterFunc

func (li ListImages) FilterFunc(predicate func(RecordImage) bool) ListImages

FilterFunc allows filtering ListImages based on a user-specified predicate.

func (ListImages) FindOne

func (li ListImages) FindOne() RecordImage

FindOne returns first found RecordImage If none was found, returns an empty struct.

func (ListImages) Serialize

func (li ListImages) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ListRequest

type ListRequest struct {
	// Filter images by storage endpoint provider ID
	// Required: false
	SepID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`

	// Find by ID
	// Required: false
	ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`

	// Find by name
	// Required: false
	Name string `url:"name,omitempty" json:"name,omitempty"`

	// Find by status
	// Required: false
	Status string `url:"status,omitempty" json:"status,omitempty"`

	// Find by architecture
	// Required: false
	Architecture string `url:"architecture,omitempty" json:"architecture,omitempty"`

	// Find by type
	// Required: false
	TypeImage string `url:"typeImage,omitempty" json:"typeImage,omitempty"`

	// Find by image size
	// Required: false
	ImageSize uint64 `url:"imageSize,omitempty" json:"imageSize,omitempty"`

	// Find by SEP name
	// Required: false
	SEPName string `url:"sepName,omitempty" json:"sepName,omitempty"`

	// Find by pool
	// Required: false
	Pool string `url:"pool,omitempty" json:"pool,omitempty"`

	// Find by public True or False
	// Required: false
	Public bool `url:"public,omitempty" json:"public,omitempty"`

	// Find by hot resize True or False
	// Required: false
	HotResize bool `url:"hotResize,omitempty" json:"hotResize,omitempty"`

	// Find by bootable True or False
	// Required: false
	Bootable bool `url:"bootable,omitempty" json:"bootable,omitempty"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

Request struct for get list available images

type ListStacks

type ListStacks struct {
	Data []struct {
		// CKey
		CKey string `json:"_ckey"`

		// Meta
		Meta []interface{} `json:"_meta"`

		// API URL
		APIURL string `json:"apiUrl"`

		// API key
		APIKey string `json:"apikey"`

		// App ID
		AppID string `json:"appId"`

		// CPU allocation ratio
		CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`

		// Description
		Description string `json:"desc"`

		// Descr
		Descr string `json:"descr"`

		// Drivers
		Drivers []string `json:"drivers"`

		// Eco
		Eco interface{} `json:"eco"`

		// Error
		Error uint64 `json:"error"`

		// Grid ID
		GID uint64 `json:"gid"`

		// GID
		GUID uint64 `json:"guid"`

		// ID
		ID uint64 `json:"id"`

		// List image IDs
		Images []uint64 `json:"images"`

		// Login
		Login string `json:"login"`

		// Mem allocation ratio
		// Required: false
		MemAllocationRatio float64 `json:"mem_allocation_ratio"`

		// Name
		Name string `json:"name"`

		// Password
		Password string `json:"passwd"`

		// Reference ID
		ReferenceID string `json:"referenceId"`

		// Status
		Status string `json:"status"`

		// Type
		Type string `json:"type"`
	} `json:"data"`

	EntryCount uint64 `json:"entryCount"`
}

List stacks

type ListStacksRequest

type ListStacksRequest struct {
	// Image ID
	// Required: true
	ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`

	// Find by name
	// Required: false
	Name string `url:"name,omitempty" json:"name,omitempty"`

	// Find by status
	// Required: false
	Status string `url:"status,omitempty" json:"status,omitempty"`

	// Find by type
	// Required: false
	Type string `url:"type,omitempty" json:"type,omitempty"`
}

Request struct for get list stack

type RecordImage

type RecordImage struct {
	// UNC path
	UNCPath string `json:"UNCPath"`

	// CKey
	CKey string `json:"_ckey"`

	// Meta
	Meta []interface{} `json:"_meta"`

	// Account ID
	AccountID uint64 `json:"accountId"`

	// Access Control List
	ACL ListACL `json:"acl"`

	// Architecture
	Architecture string `json:"architecture"`

	// Boot type
	BootType string `json:"bootType"`

	// Bootable
	Bootable bool `json:"bootable"`

	// Compute CI ID
	ComputeCIID uint64 `json:"computeciId"`

	// Deleted  time
	DeletedTime uint64 `json:"deletedTime"`

	// Description
	Description string `json:"desc"`

	// Drivers
	Drivers []string `json:"drivers"`

	// Enabled
	Enabled bool `json:"enabled"`

	// Grid ID
	GID uint64 `json:"gid"`

	// GUID
	GUID uint64 `json:"guid"`

	// List history
	History ListHistory `json:"history"`

	// Hot resize
	HotResize bool `json:"hotResize"`

	// ID
	ID uint64 `json:"id"`

	// Last modified
	LastModified uint64 `json:"lastModified"`

	// Link to
	LinkTo uint64 `json:"linkTo"`

	// Milestones
	Milestones uint64 `json:"milestones"`

	// Name
	Name string `json:"name"`

	// Password
	Password string `json:"password"`

	// Pool
	Pool string `json:"pool"`

	// Present to
	PresentTo []uint64 `json:"presentTo"`

	// Provider name
	ProviderName string `json:"provider_name"`

	// Purge attempts
	PurgeAttempts uint64 `json:"purgeAttempts"`

	// Reference ID
	ReferenceID string `json:"referenceId"`

	// Resource ID
	ResID string `json:"resId"`

	// Resource name
	ResName string `json:"resName"`

	// Rescue CD
	RescueCD bool `json:"rescuecd"`

	// SEP ID
	SEPID uint64 `json:"sepId"`

	// List shared with
	SharedWith []uint64 `json:"sharedWith"`

	// Size
	Size uint64 `json:"size"`

	// Status
	Status string `json:"status"`

	// Tech status
	TechStatus string `json:"techStatus"`

	// Type
	Type string `json:"type"`

	// URL
	URL string `json:"url"`

	// Username
	Username string `json:"username"`

	// Version
	Version string `json:"version"`

	// Virtual
	Virtual bool `json:"virtual"`
}

Detailed information about image

func (RecordImage) Serialize

func (ri RecordImage) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type RenameRequest

type RenameRequest struct {
	// ID of the virtual image to rename
	// Required: true
	ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`

	// New name
	// Required: true
	Name string `url:"name" json:"name" validate:"required"`
}

Request struct for rename image

type ShareRequest

type ShareRequest struct {
	// ID of the image to share
	// Required: true
	ImageId uint64 `url:"imageId" json:"imageId" validate:"required"`

	// List of account IDs
	// Required: true
	AccountIDs []uint64 `url:"accounts" json:"accounts" validate:"min=1"`
}

Request struct for share image

type SyncCreateRequest

type SyncCreateRequest struct {
	// Name of the rescue disk
	// Required: true
	Name string `url:"name" json:"name" validate:"required"`

	// URL where to download media from
	// Required: true
	URL string `url:"url" json:"url" validate:"required"`

	// Grid (platform) ID where this template should be create in
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`

	// Boot type of image
	// Should be one of:
	//	- bios
	//	- UEFI
	// Required: true
	BootType string `url:"boottype" json:"boottype" validate:"imageBootType"`

	// Image type
	// Should be one of:
	//	- linux
	//	- windows
	//	- or other
	// Required: true
	ImageType string `url:"imagetype" json:"imagetype" validate:"imageType"`

	// Does this machine supports hot resize
	// Required: false
	HotResize bool `url:"hotresize,omitempty" json:"hotresize,omitempty"`

	// Optional username for the image
	// Required: false
	Username string `url:"username,omitempty" json:"username,omitempty"`

	// Optional password for the image
	// Required: false
	Password string `url:"password,omitempty" json:"password,omitempty"`

	// Account ID to make the image exclusive
	// Required: false
	AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`

	// Username for upload binary media
	// Required: false
	UsernameDL string `url:"usernameDL,omitempty" json:"usernameDL,omitempty"`

	// Password for upload binary media
	// Required: false
	PasswordDL string `url:"passwordDL,omitempty" json:"passwordDL,omitempty"`

	// Storage endpoint provider ID
	// Required: false
	SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`

	// Pool for image create
	// Required: false
	PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"`

	// Binary architecture of this image
	// Should be one of:
	//	- X86_64
	//	- PPC64_LE
	// Required: false
	Architecture string `url:"architecture,omitempty" json:"architecture,omitempty"`

	// List of types of compute suitable for image
	// Example: [ "KVM_X86" ]
	// Required: true
	Drivers []string `url:"drivers" json:"drivers" validate:"min=1,max=2,imageDrivers"`

	// Bootable image or not
	// Required: false
	Bootable bool `url:"bootable,omitempty" json:"bootable,omitempty"`
}

Request struct for sync create image

type UpdateNodesRequest

type UpdateNodesRequest struct {
	// Image ID
	// Required: true
	ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`

	// List of stacks
	// Required: false
	EnabledStacks []uint64 `url:"enabledStacks,omitempty" json:"enabledStacks,omitempty"`
}

Request struct for update nodes

Jump to

Keyboard shortcuts

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