Documentation
¶
Overview ¶
Lists all the images. A image is a template which can be used to deploy machines
Index ¶
- type ACL
- type ComputeCISetRequest
- type ComputeCIUnsetRequest
- type CreateCDROMImageRequest
- type CreateRequest
- type CreateVirtualRequest
- type DeleteCDROMImageRequest
- type DeleteImagesRequest
- type DeleteRequest
- type DisableRequest
- type EditRequest
- type EnableRequest
- type GUID
- type GetRequest
- type History
- type Image
- func (i Image) ComputeCISet(ctx context.Context, req ComputeCISetRequest) (bool, error)
- func (i Image) ComputeCIUnset(ctx context.Context, req ComputeCIUnsetRequest) (bool, error)
- func (i Image) CreateCDROMImage(ctx context.Context, req CreateCDROMImageRequest) (uint64, error)
- func (i Image) CreateImage(ctx context.Context, req CreateRequest) (uint64, error)
- func (i Image) CreateVirtual(ctx context.Context, req CreateVirtualRequest) (uint64, error)
- func (i Image) Delete(ctx context.Context, req DeleteRequest) (bool, error)
- func (i Image) DeleteCDROMImage(ctx context.Context, req DeleteCDROMImageRequest) (bool, error)
- func (i Image) DeleteImages(ctx context.Context, req DeleteImagesRequest) (bool, error)
- func (i Image) Disable(ctx context.Context, req DisableRequest) (bool, error)
- func (i Image) Edit(ctx context.Context, req EditRequest) (bool, error)
- func (i Image) Enable(ctx context.Context, req EnableRequest) (bool, error)
- func (i Image) Get(ctx context.Context, req GetRequest) (*RecordImage, error)
- func (i Image) Link(ctx context.Context, req LinkRequest) (bool, error)
- func (i Image) List(ctx context.Context, req ListRequest) (*ListImages, error)
- func (i Image) ListStacks(ctx context.Context, req ListStacksRequest) (*ListStacks, error)
- func (i Image) Rename(ctx context.Context, req RenameRequest) (bool, error)
- func (i Image) Share(ctx context.Context, req ShareRequest) (bool, error)
- func (i Image) SyncCreate(ctx context.Context, req SyncCreateRequest) (uint64, error)
- func (i Image) UpdateNodes(ctx context.Context, req UpdateNodesRequest) (bool, error)
- type LinkRequest
- type ListACL
- type ListHistory
- type ListImages
- func (li ListImages) FilterByBootType(bootType string) ListImages
- func (li ListImages) FilterByID(id uint64) ListImages
- func (li ListImages) FilterByName(name string) ListImages
- func (li ListImages) FilterByStatus(status string) ListImages
- func (li ListImages) FilterByTechStatus(techStatus string) ListImages
- func (li ListImages) FilterFunc(predicate func(RecordImage) bool) ListImages
- func (li ListImages) FindOne() RecordImage
- func (li ListImages) Serialize(params ...string) (serialization.Serialized, error)
- type ListRequest
- type ListStacks
- type ListStacksRequest
- type RecordImage
- type RenameRequest
- type ShareRequest
- type SyncCreateRequest
- type UpdateNodesRequest
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 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 (Image) ComputeCISet ¶
ComputeCISet set compute CI ID for image
func (Image) ComputeCIUnset ¶
ComputeCIUnset unset compute CI ID from image
func (Image) CreateCDROMImage ¶
CreateCDROMImage creates CD-ROM image from an ISO identified by URL
func (Image) CreateImage ¶
CreateImage creates image from a media identified by URL
func (Image) CreateVirtual ¶
CreateVirtual creates virtual image
func (Image) DeleteCDROMImage ¶
DeleteCDROMImage delete a CD-ROM image
func (Image) DeleteImages ¶
DeleteImages deletes images
func (Image) Get ¶
func (i Image) Get(ctx context.Context, req GetRequest) (*RecordImage, error)
Get get image details by ID
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) SyncCreate ¶
SyncCreate creates image from a media identified by URL (in synchronous mode)
func (Image) UpdateNodes ¶
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 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"` 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 { // Required: true ImageId uint64 `url:"imageId" json:"imageId" validate:"required"` // 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
Source Files
¶
- computeci_set.go
- computeci_unset.go
- create_cdrom_image.go
- create_image.go
- create_virtual.go
- delete.go
- delete_cdrom_image.go
- delete_images.go
- disable.go
- edit.go
- enable.go
- filter.go
- get.go
- image.go
- link.go
- list.go
- list_stacks.go
- models.go
- rename.go
- serialize.go
- share.go
- sync_create_image.go
- update_nodes.go