Documentation ¶
Index ¶
- Constants
- Variables
- func CheckImages()
- func GetImage(ctx context.Context, location string) (int64, io.ReadCloser, error)
- func Init(storageBackend string)
- func InitDB() error
- func IsCheckStatusEnabled(img *SImage) bool
- func RemoveImage(ctx context.Context, location string) error
- func UpdateImageConfigTargetImageFormats(ctx context.Context, userCred mcclient.TokenCredential) error
- type LocalStorage
- func (s *LocalStorage) CleanTempfile(filePath string) error
- func (s *LocalStorage) ConvertImage(ctx context.Context, image *SImage, targetFormat string) (*SConverImageInfo, error)
- func (s *LocalStorage) GetImage(ctx context.Context, imagePath string) (int64, io.ReadCloser, error)
- func (s *LocalStorage) IsCheckStatusEnabled() bool
- func (s *LocalStorage) RemoveImage(ctx context.Context, imagePath string) error
- func (s *LocalStorage) SaveImage(ctx context.Context, imagePath string) (string, error)
- func (s *LocalStorage) Type() string
- type S3Storage
- func (s *S3Storage) CleanTempfile(filePath string) error
- func (s *S3Storage) ConvertImage(ctx context.Context, image *SImage, targetFormat string) (*SConverImageInfo, error)
- func (s *S3Storage) GetImage(ctx context.Context, imagePath string) (int64, io.ReadCloser, error)
- func (s *S3Storage) IsCheckStatusEnabled() bool
- func (s *S3Storage) RemoveImage(ctx context.Context, fileName string) error
- func (s *S3Storage) SaveImage(ctx context.Context, imagePath string) (string, error)
- func (s *S3Storage) Type() string
- type SConverImageInfo
- type SGuestImage
- func (gi *SGuestImage) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (gi *SGuestImage) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (gi *SGuestImage) Delete(ctx context.Context, userCred mcclient.TokenCredential) error
- func (gi *SGuestImage) DoCancelPendingDelete(ctx context.Context, userCred mcclient.TokenCredential) error
- func (gi *SGuestImage) GetUsages() []db.IUsage
- func (gi *SGuestImage) PerformCancelDelete(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (self *SGuestImage) PerformPrivate(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (self *SGuestImage) PerformPublic(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (img *SGuestImage) PerformSetClassMetadata(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (gi *SGuestImage) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (self *SGuestImage) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (gi *SGuestImage) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error
- func (self *SGuestImage) UpdateSubImage(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (gi *SGuestImage) ValidateDeleteCondition(ctx context.Context, info jsonutils.JSONObject) error
- type SGuestImageJoint
- type SGuestImageJointManager
- func (gt *SGuestImageJointManager) CreateGuestImageJoint(ctx context.Context, guestImageId, imageId string) (*SGuestImageJoint, error)
- func (gm *SGuestImageJointManager) GetByGuestImageId(guestImageId string) ([]SGuestImageJoint, error)
- func (gm *SGuestImageJointManager) GetByImageId(imageId string) ([]SGuestImageJoint, error)
- func (gm *SGuestImageJointManager) GetImagesByFilter(guestImageId string, filter func(q *sqlchemy.SQuery) *sqlchemy.SQuery) ([]SImage, error)
- func (gm *SGuestImageJointManager) GetImagesByGuestImageId(guestImageId string) ([]SImage, error)
- type SGuestImageManager
- func (self *SGuestImageManager) CleanPendingDeleteImages(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
- func (manager *SGuestImageManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, ...) []api.GuestImageDetails
- func (manager *SGuestImageManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (manager *SGuestImageManager) OrderByExtraFields(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (manager *SGuestImageManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)
- func (manager *SGuestImageManager) Usage(ctx context.Context, scope rbacscope.TRbacScope, ...) map[string]int64
- func (manager *SGuestImageManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.GuestImageCreateInput, error)
- type SImage
- func (self *SImage) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, ...) bool
- func (self *SImage) CanUpdate(data jsonutils.JSONObject) bool
- func (self *SImage) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (self *SImage) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (self *SImage) CustomizedGetDetailsBody(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (self *SImage) Delete(ctx context.Context, userCred mcclient.TokenCredential) error
- func (self *SImage) DoCancelPendingDelete(ctx context.Context, userCred mcclient.TokenCredential) error
- func (self *SImage) DoCheckStatus(ctx context.Context, userCred mcclient.TokenCredential, useFast bool)
- func (self *SImage) DoPendingDelete(ctx context.Context, userCred mcclient.TokenCredential) error
- func (self *SImage) GetDetailsSubformats(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (self *SImage) GetExtraDetailsHeaders(ctx context.Context, userCred mcclient.TokenCredential, ...) map[string]string
- func (self *SImage) GetImageType() api.TImageType
- func (self *SImage) GetLocalLocation() string
- func (self *SImage) GetLocalPath(format string) string
- func (self *SImage) GetNewLocation(newLocalPath string) string
- func (self *SImage) GetPath(format string) string
- func (self *SImage) GetPrefix() string
- func (img *SImage) GetQuotaKeys() quotas.IQuotaKeys
- func (img *SImage) GetUsages() []db.IUsage
- func (self *SImage) IsIso() bool
- func (self *SImage) OnJointFailed(ctx context.Context, userCred mcclient.TokenCredential)
- func (self *SImage) OnSaveFailed(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (self *SImage) OnSaveSuccess(ctx context.Context, userCred mcclient.TokenCredential, msg string)
- func (self *SImage) OnSaveTaskFailed(task taskman.ITask, userCred mcclient.TokenCredential, ...)
- func (self *SImage) OnSaveTaskSuccess(task taskman.ITask, userCred mcclient.TokenCredential, msg string)
- func (self *SImage) PerformCancelDelete(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (img *SImage) PerformChangeOwner(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (self *SImage) PerformMarkStandard(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (img *SImage) PerformPrivate(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (img *SImage) PerformProbe(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (img *SImage) PerformPublic(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (img *SImage) PerformSetClassMetadata(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (img *SImage) PerformUpdateStatus(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (self *SImage) PerformUpdateTorrentStatus(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (img *SImage) Pipeline(ctx context.Context, userCred mcclient.TokenCredential, skipProbe bool) error
- func (self *SImage) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (self *SImage) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (self *SImage) PreUpdate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (self *SImage) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error
- func (self *SImage) Remove(ctx context.Context, userCred mcclient.TokenCredential) error
- func (self *SImage) RemoveFile() error
- func (self *SImage) SaveImageFromStream(reader io.Reader, totalSize int64, calChecksum bool) error
- func (self *SImage) StartImageCheckTask(ctx context.Context, userCred mcclient.TokenCredential, parentTaskId string) error
- func (self *SImage) StartImagePipeline(ctx context.Context, userCred mcclient.TokenCredential, skipProbe bool) error
- func (self *SImage) StartPutImageTask(ctx context.Context, userCred mcclient.TokenCredential, parentTaskId string) error
- func (self *SImage) StopTorrents()
- func (img *SImage) ValidateDeleteCondition(ctx context.Context, info jsonutils.JSONObject) error
- func (self *SImage) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (*jsonutils.JSONDict, error)
- type SImageManager
- func (manager *SImageManager) CleanPendingDeleteImages(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
- func (manager *SImageManager) CustomizeHandlerInfo(info *appsrv.SHandlerInfo)
- func (manager *SImageManager) FetchCreateHeaderData(ctx context.Context, header http.Header) (jsonutils.JSONObject, error)
- func (manager *SImageManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, ...) []api.ImageDetails
- func (manager *SImageManager) FetchUpdateHeaderData(ctx context.Context, header http.Header) (jsonutils.JSONObject, error)
- func (manager *SImageManager) GetPropertyDetail(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (manager *SImageManager) InitializeData() error
- func (manager *SImageManager) IsCustomizedGetDetailsBody() bool
- func (manager *SImageManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (manager *SImageManager) OrderByExtraFields(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (m *SImageManager) PerformVmwareAccountAdded(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (manager *SImageManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)
- func (manager *SImageManager) Usage(ctx context.Context, scope rbacscope.TRbacScope, ...) map[string]int64
- func (manager *SImageManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.ImageCreateInput, error)
- type SImageMember
- type SImageMemberManager
- type SImagePeripheral
- type SImageProperty
- type SImagePropertyManager
- func (manager *SImagePropertyManager) GetProperties(imageId string) (map[string]string, error)
- func (manager *SImagePropertyManager) GetProperty(imageId string, key string) (*SImageProperty, error)
- func (manager *SImagePropertyManager) NewProperty(ctx context.Context, userCred mcclient.TokenCredential, imageId string, ...) (*SImageProperty, error)
- func (manager *SImagePropertyManager) SaveProperties(ctx context.Context, userCred mcclient.TokenCredential, imageId string, ...) error
- func (manager *SImagePropertyManager) SaveProperty(ctx context.Context, userCred mcclient.TokenCredential, imageId string, ...) (*SImageProperty, error)
- type SImageQuotaDetail
- type SImageQuotaKeys
- type SImageSubformat
- func (self *SImageSubformat) GetDetails() SImageSubformatDetails
- func (self *SImageSubformat) GetLocalLocation() string
- func (self *SImageSubformat) Save(image *SImage) error
- func (self *SImageSubformat) SaveTorrent() error
- func (self *SImageSubformat) SetStatus(status string) error
- func (self *SImageSubformat) SetStatusSeeding(seeding bool)
- func (self *SImageSubformat) StopTorrent()
- type SImageSubformatDetails
- type SImageSubformatManager
- type SImageTag
- type SImageTagManager
- type SImageUsage
- type SQuota
- func (self *SQuota) Add(quota quotas.IQuota)
- func (self *SQuota) Allocable(request quotas.IQuota) int
- func (used *SQuota) Exceed(request quotas.IQuota, quota quotas.IQuota) error
- func (self *SQuota) FetchSystemQuota()
- func (self *SQuota) FetchUsage(ctx context.Context) error
- func (self *SQuota) GetKeys() quotas.IQuotaKeys
- func (self *SQuota) IsEmpty() bool
- func (self *SQuota) ResetNegative()
- func (self *SQuota) SetKeys(keys quotas.IQuotaKeys)
- func (self *SQuota) Sub(quota quotas.IQuota)
- func (self *SQuota) ToJSON(prefix string) jsonutils.JSONObject
- func (self *SQuota) Update(quota quotas.IQuota)
- type SQuotaManager
- type SetImageQuotaInput
- type Storage
Constants ¶
const ( FileNoExists sUnactiveReason = iota FileSizeMismatch FileChecksumMismatch Others )
const (
LocalFilePrefix = api.LocalFilePrefix
)
Variables ¶
var ( ImageQuota SQuota QuotaManager *SQuotaManager QuotaUsageManager *SQuotaManager QuotaPendingUsageManager *SQuotaManager )
Functions ¶
func CheckImages ¶
func CheckImages()
func IsCheckStatusEnabled ¶
func UpdateImageConfigTargetImageFormats ¶
func UpdateImageConfigTargetImageFormats(ctx context.Context, userCred mcclient.TokenCredential) error
Types ¶
type LocalStorage ¶
type LocalStorage struct{}
func (*LocalStorage) CleanTempfile ¶
func (s *LocalStorage) CleanTempfile(filePath string) error
func (*LocalStorage) ConvertImage ¶
func (s *LocalStorage) ConvertImage(ctx context.Context, image *SImage, targetFormat string) (*SConverImageInfo, error)
func (*LocalStorage) GetImage ¶
func (s *LocalStorage) GetImage(ctx context.Context, imagePath string) (int64, io.ReadCloser, error)
func (*LocalStorage) IsCheckStatusEnabled ¶
func (s *LocalStorage) IsCheckStatusEnabled() bool
func (*LocalStorage) RemoveImage ¶
func (s *LocalStorage) RemoveImage(ctx context.Context, imagePath string) error
func (*LocalStorage) Type ¶
func (s *LocalStorage) Type() string
type S3Storage ¶
type S3Storage struct{}
func (*S3Storage) CleanTempfile ¶
func (*S3Storage) ConvertImage ¶
func (*S3Storage) IsCheckStatusEnabled ¶
func (*S3Storage) RemoveImage ¶
type SConverImageInfo ¶
type SGuestImage ¶
type SGuestImage struct { db.SSharableVirtualResourceBase db.SMultiArchResourceBase db.SEncryptedResource Protected tristate.TriState `default:"true" list:"user" get:"user" create:"optional" update:"user"` }
func (*SGuestImage) CustomizeCreate ¶
func (gi *SGuestImage) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SGuestImage) CustomizeDelete ¶
func (gi *SGuestImage) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SGuestImage) Delete ¶
func (gi *SGuestImage) Delete(ctx context.Context, userCred mcclient.TokenCredential) error
func (*SGuestImage) DoCancelPendingDelete ¶
func (gi *SGuestImage) DoCancelPendingDelete(ctx context.Context, userCred mcclient.TokenCredential) error
func (*SGuestImage) GetUsages ¶
func (gi *SGuestImage) GetUsages() []db.IUsage
func (*SGuestImage) PerformCancelDelete ¶
func (gi *SGuestImage) PerformCancelDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SGuestImage) PerformPrivate ¶
func (self *SGuestImage) PerformPrivate( ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformPrivateInput, ) (jsonutils.JSONObject, error)
func (*SGuestImage) PerformPublic ¶
func (self *SGuestImage) PerformPublic( ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformPublicProjectInput, ) (jsonutils.JSONObject, error)
func (*SGuestImage) PerformSetClassMetadata ¶
func (img *SGuestImage) PerformSetClassMetadata(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformSetClassMetadataInput) (jsonutils.JSONObject, error)
func (*SGuestImage) PostCreate ¶
func (gi *SGuestImage) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SGuestImage) PostUpdate ¶
func (self *SGuestImage) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SGuestImage) RealDelete ¶
func (gi *SGuestImage) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error
func (*SGuestImage) UpdateSubImage ¶
func (self *SGuestImage) UpdateSubImage(ctx context.Context, userCred mcclient.TokenCredential, data jsonutils.JSONObject) error
func (*SGuestImage) ValidateDeleteCondition ¶
func (gi *SGuestImage) ValidateDeleteCondition(ctx context.Context, info jsonutils.JSONObject) error
type SGuestImageJoint ¶
type SGuestImageJoint struct { db.SJointResourceBase GuestImageId string `width:"128" charset:"ascii" create:"required"` ImageId string `width:"128" charset:"ascii" create:"required"` }
func (*SGuestImageJoint) GetId ¶
func (gt *SGuestImageJoint) GetId() string
func (*SGuestImageJoint) RealDelete ¶
func (gt *SGuestImageJoint) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error
type SGuestImageJointManager ¶
type SGuestImageJointManager struct {
db.SJointResourceBaseManager
}
+onecloud:swagger-gen-ignore
var GuestImageJointManager *SGuestImageJointManager
func (*SGuestImageJointManager) CreateGuestImageJoint ¶
func (gt *SGuestImageJointManager) CreateGuestImageJoint(ctx context.Context, guestImageId, imageId string) (*SGuestImageJoint, error)
func (*SGuestImageJointManager) GetByGuestImageId ¶
func (gm *SGuestImageJointManager) GetByGuestImageId(guestImageId string) ([]SGuestImageJoint, error)
func (*SGuestImageJointManager) GetByImageId ¶
func (gm *SGuestImageJointManager) GetByImageId(imageId string) ([]SGuestImageJoint, error)
func (*SGuestImageJointManager) GetImagesByFilter ¶
func (*SGuestImageJointManager) GetImagesByGuestImageId ¶
func (gm *SGuestImageJointManager) GetImagesByGuestImageId(guestImageId string) ([]SImage, error)
type SGuestImageManager ¶
type SGuestImageManager struct { db.SSharableVirtualResourceBaseManager db.SMultiArchResourceBaseManager db.SEncryptedResourceManager }
var GuestImageManager *SGuestImageManager
func (*SGuestImageManager) CleanPendingDeleteImages ¶
func (self *SGuestImageManager) CleanPendingDeleteImages(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
func (*SGuestImageManager) FetchCustomizeColumns ¶
func (manager *SGuestImageManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool, ) []api.GuestImageDetails
func (*SGuestImageManager) ListItemFilter ¶
func (manager *SGuestImageManager) ListItemFilter( ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query api.GuestImageListInput, ) (*sqlchemy.SQuery, error)
主机镜像列表
func (*SGuestImageManager) OrderByExtraFields ¶
func (manager *SGuestImageManager) OrderByExtraFields( ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query api.GuestImageListInput, ) (*sqlchemy.SQuery, error)
func (*SGuestImageManager) QueryDistinctExtraField ¶
func (*SGuestImageManager) Usage ¶
func (manager *SGuestImageManager) Usage(ctx context.Context, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, prefix string, policyResult rbacutils.SPolicyResult) map[string]int64
func (*SGuestImageManager) ValidateCreateData ¶
func (manager *SGuestImageManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input api.GuestImageCreateInput) (api.GuestImageCreateInput, error)
type SImage ¶
type SImage struct { db.SSharableVirtualResourceBase db.SMultiArchResourceBase db.SEncryptedResource // 镜像大小, 单位Byte Size int64 `nullable:"true" list:"user" create:"optional"` // 存储地址 Location string `nullable:"true" list:"user"` // 镜像格式 DiskFormat string `width:"20" charset:"ascii" nullable:"true" list:"user" create:"optional" default:"raw"` // 校验和 Checksum string `width:"32" charset:"ascii" nullable:"true" get:"user" list:"user"` FastHash string `width:"32" charset:"ascii" nullable:"true" get:"user"` // 用户Id Owner string `width:"255" charset:"ascii" nullable:"true" get:"user"` // 最小系统盘要求 MinDiskMB int32 `name:"min_disk" nullable:"false" default:"0" list:"user" create:"optional" update:"user"` // 最小内存要求 MinRamMB int32 `name:"min_ram" nullable:"false" default:"0" list:"user" create:"optional" update:"user"` // 是否有删除保护 Protected tristate.TriState `default:"true" list:"user" get:"user" create:"optional" update:"user"` // 是否是标准镜像 IsStandard tristate.TriState `default:"false" list:"user" get:"user" create:"admin_optional" update:"user"` // 是否是主机镜像 IsGuestImage tristate.TriState `default:"false" create:"optional" list:"user"` // 是否是数据盘镜像 IsData tristate.TriState `default:"false" create:"optional" list:"user" update:"user"` // image copy from url, save origin checksum before probe // 从镜像时长导入的镜像校验和 OssChecksum string `width:"32" charset:"ascii" nullable:"true" get:"user" list:"user"` // 加密状态, "",encrypting,encrypted EncryptStatus string `width:"16" charset:"ascii" nullable:"true" get:"user" list:"user"` }
+------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------+-------+ | id | varchar(36) | NO | PRI | NULL | | | name | varchar(255) | YES | | NULL | | | size | bigint(20) | YES | | NULL | | | status | varchar(30) | NO | | NULL | | | is_public | tinyint(1) | NO | MUL | NULL | | | location | text | YES | | NULL | | | created_at | datetime | NO | | NULL | | | updated_at | datetime | YES | | NULL | | | deleted_at | datetime | YES | | NULL | | | deleted | tinyint(1) | NO | MUL | NULL | | | parent_id | varchar(36) | YES | | NULL | | | disk_format | varchar(20) | YES | | NULL | | | container_format | varchar(20) | YES | | NULL | | | checksum | varchar(32) | YES | | NULL | | | owner | varchar(255) | YES | | NULL | | | min_disk | int(11) | NO | | NULL | | | min_ram | int(11) | NO | | NULL | | | protected | tinyint(1) | YES | | NULL | | | description | varchar(256) | YES | | NULL | | +------------------+--------------+------+-----+---------+-------+
func (*SImage) AllowDeleteItem ¶
func (self *SImage) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool
func (*SImage) CustomizeCreate ¶
func (self *SImage) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SImage) CustomizeDelete ¶
func (self *SImage) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SImage) CustomizedGetDetailsBody ¶
func (self *SImage) CustomizedGetDetailsBody(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SImage) DoCancelPendingDelete ¶
func (*SImage) DoCheckStatus ¶
func (*SImage) DoPendingDelete ¶
func (*SImage) GetDetailsSubformats ¶
func (self *SImage) GetDetailsSubformats(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SImage) GetExtraDetailsHeaders ¶
func (self *SImage) GetExtraDetailsHeaders(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) map[string]string
func (*SImage) GetImageType ¶
func (self *SImage) GetImageType() api.TImageType
func (*SImage) GetLocalLocation ¶
func (*SImage) GetLocalPath ¶
func (*SImage) GetNewLocation ¶
func (*SImage) GetQuotaKeys ¶
func (img *SImage) GetQuotaKeys() quotas.IQuotaKeys
func (*SImage) OnJointFailed ¶
func (self *SImage) OnJointFailed(ctx context.Context, userCred mcclient.TokenCredential)
func (*SImage) OnSaveFailed ¶
func (self *SImage) OnSaveFailed(ctx context.Context, userCred mcclient.TokenCredential, msg jsonutils.JSONObject)
func (*SImage) OnSaveSuccess ¶
func (*SImage) OnSaveTaskFailed ¶
func (self *SImage) OnSaveTaskFailed(task taskman.ITask, userCred mcclient.TokenCredential, msg jsonutils.JSONObject)
func (*SImage) OnSaveTaskSuccess ¶
func (*SImage) PerformCancelDelete ¶
func (self *SImage) PerformCancelDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SImage) PerformChangeOwner ¶
func (img *SImage) PerformChangeOwner(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformChangeProjectOwnerInput) (jsonutils.JSONObject, error)
func (*SImage) PerformMarkStandard ¶
func (self *SImage) PerformMarkStandard( ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject, ) (jsonutils.JSONObject, error)
func (*SImage) PerformPrivate ¶
func (img *SImage) PerformPrivate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformPrivateInput) (jsonutils.JSONObject, error)
func (*SImage) PerformProbe ¶
func (img *SImage) PerformProbe(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.PerformProbeInput) (jsonutils.JSONObject, error)
func (*SImage) PerformPublic ¶
func (img *SImage) PerformPublic(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformPublicProjectInput) (jsonutils.JSONObject, error)
func (*SImage) PerformSetClassMetadata ¶
func (img *SImage) PerformSetClassMetadata(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformSetClassMetadataInput) (jsonutils.JSONObject, error)
func (*SImage) PerformUpdateStatus ¶
func (img *SImage) PerformUpdateStatus(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.ImageUpdateStatusInput) (jsonutils.JSONObject, error)
func (*SImage) PerformUpdateTorrentStatus ¶
func (self *SImage) PerformUpdateTorrentStatus(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SImage) PostCreate ¶
func (self *SImage) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SImage) PostUpdate ¶
func (self *SImage) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SImage) PreUpdate ¶
func (self *SImage) PreUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SImage) RealDelete ¶
func (*SImage) RemoveFile ¶
func (*SImage) SaveImageFromStream ¶
Image always do probe and customize after save from stream
func (*SImage) StartImageCheckTask ¶
func (*SImage) StartImagePipeline ¶
func (self *SImage) StartImagePipeline( ctx context.Context, userCred mcclient.TokenCredential, skipProbe bool, ) error
After image probe and customization, image size and checksum changed will recalculate checksum in the end
func (*SImage) StartPutImageTask ¶
func (*SImage) StopTorrents ¶
func (self *SImage) StopTorrents()
func (*SImage) ValidateDeleteCondition ¶
func (*SImage) ValidateUpdateData ¶
type SImageManager ¶
type SImageManager struct { db.SSharableVirtualResourceBaseManager db.SMultiArchResourceBaseManager db.SEncryptedResourceManager }
var ImageManager *SImageManager
func (*SImageManager) CleanPendingDeleteImages ¶
func (manager *SImageManager) CleanPendingDeleteImages(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
func (*SImageManager) CustomizeHandlerInfo ¶
func (manager *SImageManager) CustomizeHandlerInfo(info *appsrv.SHandlerInfo)
func (*SImageManager) FetchCreateHeaderData ¶
func (manager *SImageManager) FetchCreateHeaderData(ctx context.Context, header http.Header) (jsonutils.JSONObject, error)
func (*SImageManager) FetchCustomizeColumns ¶
func (manager *SImageManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool, ) []api.ImageDetails
func (*SImageManager) FetchUpdateHeaderData ¶
func (manager *SImageManager) FetchUpdateHeaderData(ctx context.Context, header http.Header) (jsonutils.JSONObject, error)
func (*SImageManager) GetPropertyDetail ¶
func (manager *SImageManager) GetPropertyDetail(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SImageManager) InitializeData ¶
func (manager *SImageManager) InitializeData() error
func (*SImageManager) IsCustomizedGetDetailsBody ¶
func (manager *SImageManager) IsCustomizedGetDetailsBody() bool
func (*SImageManager) ListItemFilter ¶
func (manager *SImageManager) ListItemFilter( ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query api.ImageListInput, ) (*sqlchemy.SQuery, error)
磁盘镜像列表
func (*SImageManager) OrderByExtraFields ¶
func (manager *SImageManager) OrderByExtraFields( ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query api.ImageListInput, ) (*sqlchemy.SQuery, error)
func (*SImageManager) PerformVmwareAccountAdded ¶
func (m *SImageManager) PerformVmwareAccountAdded(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformChangeProjectOwnerInput) (jsonutils.JSONObject, error)
func (*SImageManager) QueryDistinctExtraField ¶
func (*SImageManager) Usage ¶
func (manager *SImageManager) Usage(ctx context.Context, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, prefix string, policyResult rbacutils.SPolicyResult) map[string]int64
func (*SImageManager) ValidateCreateData ¶
func (manager *SImageManager) ValidateCreateData( ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input api.ImageCreateInput, ) (api.ImageCreateInput, error)
type SImageMember ¶
type SImageMember struct { SImagePeripheral Member string `width:"255" nullable:"false"` }
type SImageMemberManager ¶
type SImageMemberManager struct {
db.SResourceBaseManager
}
+onecloud:swagger-gen-ignore
var ImageMemberManager *SImageMemberManager
type SImagePeripheral ¶
type SImagePeripheral struct { db.SResourceBase Id int `primary:"true" auto_increment:"true" nullable:"false"` ImageId string `width:"36" index:"true" nullable:"false"` }
func (*SImagePeripheral) GetId ¶
func (ip *SImagePeripheral) GetId() string
type SImageProperty ¶
type SImageProperty struct { SImagePeripheral Name string `width:"255"` Value string `nullable:"true" create:"optional"` }
+------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | image_id | varchar(36) | NO | MUL | NULL | | | name | varchar(255) | NO | | NULL | | | value | text | YES | | NULL | | | created_at | datetime | NO | | NULL | | | updated_at | datetime | YES | | NULL | | | deleted_at | datetime | YES | | NULL | | | deleted | tinyint(1) | NO | MUL | NULL | | +------------+--------------+------+-----+---------+----------------+
func (*SImageProperty) UpdateValue ¶
func (self *SImageProperty) UpdateValue(ctx context.Context, userCred mcclient.TokenCredential, value string) error
type SImagePropertyManager ¶
type SImagePropertyManager struct {
db.SResourceBaseManager
}
+onecloud:swagger-gen-ignore
var ImagePropertyManager *SImagePropertyManager
func (*SImagePropertyManager) GetProperties ¶
func (manager *SImagePropertyManager) GetProperties(imageId string) (map[string]string, error)
func (*SImagePropertyManager) GetProperty ¶
func (manager *SImagePropertyManager) GetProperty(imageId string, key string) (*SImageProperty, error)
func (*SImagePropertyManager) NewProperty ¶
func (manager *SImagePropertyManager) NewProperty(ctx context.Context, userCred mcclient.TokenCredential, imageId string, key string, value string) (*SImageProperty, error)
func (*SImagePropertyManager) SaveProperties ¶
func (manager *SImagePropertyManager) SaveProperties(ctx context.Context, userCred mcclient.TokenCredential, imageId string, props jsonutils.JSONObject) error
func (*SImagePropertyManager) SaveProperty ¶
func (manager *SImagePropertyManager) SaveProperty(ctx context.Context, userCred mcclient.TokenCredential, imageId string, key string, value string) (*SImageProperty, error)
type SImageQuotaDetail ¶
type SImageQuotaDetail struct { SQuota quotas.SBaseProjectQuotaDetailKeys }
区域配额详情
func GetImageQuota ¶
func GetImageQuota(query quotas.SBaseQuotaQueryInput) *SImageQuotaDetail
获取指定项目或者域的镜像配额
func ListImageQuotas ¶
func ListImageQuotas(query quotas.SBaseQuotaQueryInput) *SImageQuotaDetail
获取所有项目或者域的镜像配额
func SetRegionQuotas ¶
func SetRegionQuotas(input SetImageQuotaInput) *SImageQuotaDetail
设置指定项目或者域的镜像配额
type SImageQuotaKeys ¶
type SImageQuotaKeys struct { quotas.SBaseProjectQuotaKeys Type string `width:"16" charset:"ascii" nullable:"false" primary:"true" list:"user"` }
func (SImageQuotaKeys) Compare ¶
func (k1 SImageQuotaKeys) Compare(ik quotas.IQuotaKeys) int
func (SImageQuotaKeys) Fields ¶
func (k SImageQuotaKeys) Fields() []string
func (SImageQuotaKeys) Values ¶
func (k SImageQuotaKeys) Values() []string
type SImageSubformat ¶
type SImageSubformat struct { SImagePeripheral Format string `width:"20" charset:"ascii" nullable:"true"` Size int64 `nullable:"true"` Location string `nullable:"true"` Checksum string `width:"32" charset:"ascii" nullable:"true"` FastHash string `width:"32" charset:"ascii" nullable:"true"` Status string `nullable:"false"` TorrentSize int64 `nullable:"true"` TorrentLocation string `nullable:"true"` TorrentChecksum string `width:"32" charset:"ascii" nullable:"true"` TorrentStatus string `nullable:"false"` }
func (*SImageSubformat) GetDetails ¶
func (self *SImageSubformat) GetDetails() SImageSubformatDetails
func (*SImageSubformat) GetLocalLocation ¶
func (self *SImageSubformat) GetLocalLocation() string
func (*SImageSubformat) Save ¶
func (self *SImageSubformat) Save(image *SImage) error
func (*SImageSubformat) SaveTorrent ¶
func (self *SImageSubformat) SaveTorrent() error
func (*SImageSubformat) SetStatus ¶
func (self *SImageSubformat) SetStatus(status string) error
func (*SImageSubformat) SetStatusSeeding ¶
func (self *SImageSubformat) SetStatusSeeding(seeding bool)
func (*SImageSubformat) StopTorrent ¶
func (self *SImageSubformat) StopTorrent()
type SImageSubformatDetails ¶
type SImageSubformatManager ¶
type SImageSubformatManager struct {
db.SResourceBaseManager
}
+onecloud:swagger-gen-ignore
var ImageSubformatManager *SImageSubformatManager
func (*SImageSubformatManager) FetchSubImage ¶
func (manager *SImageSubformatManager) FetchSubImage(id string, format string) *SImageSubformat
func (*SImageSubformatManager) GetAllSubImages ¶
func (manager *SImageSubformatManager) GetAllSubImages(id string) []SImageSubformat
type SImageTag ¶
type SImageTag struct { SImagePeripheral Value string `width:"255" nullable:"false"` }
+------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | image_id | varchar(36) | NO | MUL | NULL | | | value | varchar(255) | NO | | NULL | | | created_at | datetime | NO | | NULL | | | updated_at | datetime | YES | | NULL | | | deleted_at | datetime | YES | | NULL | | | deleted | tinyint(1) | NO | | NULL | | +------------+--------------+------+-----+---------+----------------+
type SImageTagManager ¶
type SImageTagManager struct {
db.SResourceBaseManager
}
+onecloud:swagger-gen-ignore
var ImageTagManager *SImageTagManager
type SImageUsage ¶
type SQuota ¶
type SQuota struct { quotas.SQuotaBase SImageQuotaKeys Image int `default:"-1" allow_zero:"true"` }
func (*SQuota) FetchSystemQuota ¶
func (self *SQuota) FetchSystemQuota()
func (*SQuota) GetKeys ¶
func (self *SQuota) GetKeys() quotas.IQuotaKeys
func (*SQuota) ResetNegative ¶
func (self *SQuota) ResetNegative()
func (*SQuota) SetKeys ¶
func (self *SQuota) SetKeys(keys quotas.IQuotaKeys)
type SQuotaManager ¶
type SQuotaManager struct {
quotas.SQuotaBaseManager
}
type SetImageQuotaInput ¶
type SetImageQuotaInput struct { quotas.SBaseQuotaSetInput SQuota }
设置镜像配额输入参数
type Storage ¶
type Storage interface { Type() string SaveImage(context.Context, string) (string, error) CleanTempfile(string) error GetImage(context.Context, string) (int64, io.ReadCloser, error) RemoveImage(context.Context, string) error IsCheckStatusEnabled() bool ConvertImage(ctx context.Context, image *SImage, targetFormat string) (*SConverImageInfo, error) }
func GetStorage ¶
func GetStorage() Storage