image

package
v0.3.11-8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 14

Documentation

Index

Constants

View Source
const (
	SERVICE_TYPE    = apis.SERVICE_TYPE_IMAGE
	SERVICE_VERSION = ""

	// https://docs.openstack.org/glance/pike/user/statuses.html
	//
	IMAGE_STATUS_QUEUED     = "queued"
	IMAGE_STATUS_SAVING     = "saving"
	IMAGE_STATUS_SAVE_FAIL  = "save_fail"
	IMAGE_STATUS_SAVED      = "saved"
	IMAGE_STATUS_ACTIVE     = "active"
	IMAGE_STATUS_CONVERTING = "converting"
	IMAGE_STATUS_PROBING    = "probing"

	IMAGE_ENCRYPT_STATUS_UNENCRYPTED = ""
	IMAGE_ENCRYPT_STATUS_ENCRYPTED   = "encrypted"
	IMAGE_ENCRYPT_STATUS_ENCRYPTING  = "encrypting"

	IMAGE_STATUS_DEACTIVATED    = "deactivated"
	IMAGE_STATUS_KILLED         = "killed"
	IMAGE_STATUS_DELETED        = "deleted"
	IMAGE_STATUS_PENDING_DELETE = "pending_delete"

	IMAGE_STATUS_SYNC_CLASS_METADATA_FAILEd = "sync_class_metadata_failed"

	ImageTypeTemplate = TImageType("image")
	ImageTypeISO      = TImageType("iso")

	LocalFilePrefix = "file://"
	S3Prefix        = "s3://"

	IMAGE_STORAGE_DRIVER_LOCAL = "local"
	IMAGE_STORAGE_DRIVER_S3    = "s3"

	// image properties
	IMAGE_OS_ARCH             = "os_arch"
	IMAGE_OS_DISTRO           = "os_distribution"
	IMAGE_OS_TYPE             = "os_type"
	IMAGE_OS_VERSION          = "os_version"
	IMAGE_DISK_FORMAT         = "disk_format"
	IMAGE_UEFI_SUPPORT        = "uefi_support"
	IMAGE_IS_LVM_PARTITION    = "is_lvm_partition"
	IMAGE_IS_READONLY         = "is_readonly"
	IMAGE_PARTITION_TYPE      = "partition_type"
	IMAGE_INSTALLED_CLOUDINIT = "installed_cloud_init"
	IMAGE_DISABLE_USB_KBD     = "disable_usb_kbd"
	IMAGE_VDI_PROTOCOL        = "vdi_protocol"

	IMAGE_STATUS_UPDATING = "updating"
)

Variables

Functions

This section is empty.

Types

type GuestImageCreateInput

type GuestImageCreateInput struct {
	GuestImageCreateInputBase

	// 镜像列表
	Images []GuestImageCreateInputSubimage `json:"images"`

	// 镜像大小, 单位Byte
	Size *int64 `json:"size"`
	// CPU架构 x86_64 or aarch64
	OsArch string `json:"os_arch"`

	// 镜像属性
	Properties map[string]string `json:"properties"`
}

type GuestImageCreateInputBase

type GuestImageCreateInputBase struct {
	apis.SharableVirtualResourceCreateInput
	apis.EncryptedResourceCreateInput

	// 备注
	Notes string `json:"notes"`
	// 镜像格式
	DiskFormat string `json:"disk_format"`
	// 是否有删除保护
	Protected *bool `json:"protected"`
}

type GuestImageCreateInputSubimage

type GuestImageCreateInputSubimage struct {
	// Id
	Id string `json:"id"`
	// 磁盘格式
	DiskFormat string `json:"disk_format"`
	// 磁盘大小
	VirtualSize int `json:"virtual_size"`
}

type GuestImageDetails

type GuestImageDetails struct {
	apis.SharableVirtualResourceDetails
	apis.EncryptedResourceDetails

	SGuestImage

	//Status     string               `json:"status"`
	Size       int64          `json:"size"`
	MinRamMb   int32          `json:"min_ram_mb"`
	DiskFormat string         `json:"disk_format"`
	RootImage  SubImageInfo   `json:"root_image"`
	DataImages []SubImageInfo `json:"data_images"`

	Properties *jsonutils.JSONDict `json:"properties"`

	DisableDelete bool `json:"disable_delete"`
}

type GuestImageListInput

type GuestImageListInput struct {
	apis.SharableVirtualResourceListInput
	apis.MultiArchResourceBaseListInput

	// 是否删除保护
	Protected *bool `json:"protected"`

	DiskFormat []string `json:"disk_format"`
}

type ImageCreateInput

type ImageCreateInput struct {
	apis.SharableVirtualResourceCreateInput

	// 镜像大小, 单位Byte
	Size *int64 `json:"size"`
	// 镜像格式
	DiskFormat string `json:"disk_format"`
	// 最小系统盘要求
	MinDiskMB *int32 `json:"min_disk"`
	// 最小内存要求
	MinRamMB *int32 `json:"min_ram"`
	// 是否有删除保护
	Protected *bool `json:"protected"`
	// 是否是标准镜像
	IsStandard *bool `json:"is_standard"`
	// 是否是主机镜像
	IsGuestImage *bool `json:"is_guest_image"`
	// 是否是数据盘镜像
	IsData *bool `json:"is_data"`

	apis.EncryptedResourceCreateInput

	// 镜像属性
	Properties map[string]string `json:"properties"`
}

type ImageDetails

type ImageDetails struct {
	apis.SharableVirtualResourceDetails
	apis.EncryptedResourceDetails

	SImage

	// 镜像属性信息
	Properties map[string]string `json:"properties"`
	// 自动清除时间
	AutoDeleteAt time.Time `json:"auto_delete_at"`
	// 删除保护
	DisableDelete bool `json:"disable_delete"`
}

type ImageListInput

type ImageListInput struct {
	apis.SharableVirtualResourceListInput
	apis.MultiArchResourceBaseListInput

	// 以镜像的格式过滤,可能值为:qcow2, iso, vmdk, vhd, raw等
	DiskFormats []string `json:"disk_formats"`
	// 列出是否支持UEFI启动的镜像
	Uefi *bool `json:"uefi"`

	// 根据已转换格式过滤, 可能值为: qcow2, vmdk, vhd, raw等
	SubFormats []string `json:"subFormats"`

	// 是否为标准镜像
	IsStandard *bool `json:"is_standard"`

	// 是否删除保护
	Protected *bool `json:"protected"`

	// 是否为主机镜像的子镜像
	IsGuestImage *bool `json:"is_guest_image"`

	// 是否为数据盘
	IsData *bool `json:"is_data"`

	// 操作系统类型,可能值为: Linux, Windows, FreeBSD 等
	OsTypes []string `json:"os_types"`
	// 操作系统精确匹配
	OsTypePreciseMatch bool `json:"os_type_precise_match"`

	// 操作系统架构, 可能值为: arm, x86 等
	OsArchs []string `json:"os_archs"`
	// 操作系统架构精确匹配
	OsArchPreciseMatch bool `json:"os_arch_precise_match"`

	// 发行版本,可能值为: CentOS, Ubuntu, Debian, ArchLinux,  OpenEuler 等
	Distributions []string `json:"distributions"`
	// 发行版精确匹配
	DistributionPreciseMatch bool `json:"distribution_precise_match`
}

type ImageUpdateStatusInput

type ImageUpdateStatusInput struct {
	apis.Meta

	// 镜像状态
	Status string `json:"status"`
	// 更新镜像状态原因
	Reason string `json:"reason"`
}

type PerformProbeInput

type PerformProbeInput struct {
}

type SGuestImage

type SGuestImage struct {
	apis.SSharableVirtualResourceBase
	apis.SMultiArchResourceBase
	apis.SEncryptedResource
	Protected *bool `json:"protected,omitempty"`
}

SGuestImage is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SGuestImage.

type SGuestImageJoint

type SGuestImageJoint struct {
	apis.SJointResourceBase
	GuestImageId string `json:"guest_image_id"`
	ImageId      string `json:"image_id"`
}

SGuestImageJoint is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SGuestImageJoint.

type SImage

type SImage struct {
	apis.SSharableVirtualResourceBase
	apis.SMultiArchResourceBase
	apis.SEncryptedResource
	// 镜像大小, 单位Byte
	Size int64 `json:"size"`
	// 存储地址
	Location string `json:"location"`
	// 镜像格式
	DiskFormat string `json:"disk_format"`
	// 校验和
	Checksum string `json:"checksum"`
	FastHash string `json:"fast_hash"`
	// 用户Id
	Owner string `json:"owner"`
	// 最小系统盘要求
	MinDiskMB int32 `json:"min_disk"`
	// 最小内存要求
	MinRamMB int32 `json:"min_ram"`
	// 是否有删除保护
	Protected *bool `json:"protected,omitempty"`
	// 是否是标准镜像
	IsStandard *bool `json:"is_standard,omitempty"`
	// 是否是主机镜像
	IsGuestImage *bool `json:"is_guest_image,omitempty"`
	// 是否是数据盘镜像
	IsData *bool `json:"is_data,omitempty"`
	// image copy from url, save origin checksum before probe
	// 从镜像时长导入的镜像校验和
	OssChecksum string `json:"oss_checksum"`
	// 加密状态, "",encrypting,encrypted
	EncryptStatus string `json:"encrypt_status"`
}

SImage is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImage.

type SImageMember

type SImageMember struct {
	SImagePeripheral
	Member   string `json:"member"`
	CanShare bool   `json:"can_share"`
}

SImageMember is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageMember.

type SImagePeripheral

type SImagePeripheral struct {
	apis.SResourceBase
	Id      int    `json:"id"`
	ImageId string `json:"image_id"`
}

SImagePeripheral is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImagePeripheral.

type SImageProperty

type SImageProperty struct {
	SImagePeripheral
	Name  string `json:"name"`
	Value string `json:"value"`
}

SImageProperty is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageProperty.

type SImageSubformat

type SImageSubformat struct {
	SImagePeripheral
	Format          string `json:"format"`
	Size            int64  `json:"size"`
	Location        string `json:"location"`
	Checksum        string `json:"checksum"`
	FastHash        string `json:"fast_hash"`
	Status          string `json:"status"`
	TorrentSize     int64  `json:"torrent_size"`
	TorrentLocation string `json:"torrent_location"`
	TorrentChecksum string `json:"torrent_checksum"`
	TorrentStatus   string `json:"torrent_status"`
}

SImageSubformat is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageSubformat.

type SImageTag

type SImageTag struct {
	SImagePeripheral
	Value string `json:"value"`
}

SImageTag is an autogenerated struct via yunion.io/x/onecloud/pkg/image/models.SImageTag.

type SubImageInfo

type SubImageInfo struct {
	ID         string    `json:"id"`
	Name       string    `json:"name"`
	MinDiskMB  int32     `json:"min_disk_mb"`
	DiskFormat string    `json:"disk_format"`
	Size       int64     `json:"size"`
	Status     string    `json:"status"`
	CreatedAt  time.Time `json:"created_at"`

	EncryptKeyId  string `json:"encrypt_key_id"`
	DisableDelete bool   `json:"disable_delete"`
}

type TImageType

type TImageType string

Jump to

Keyboard shortcuts

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