Documentation ¶
Index ¶
- type API
- func (a *API) ChangeVisibility(region string, id string, public bool) error
- func (a *API) CopyImage(source_id, dest_name, dest_region, dest_description, kms_key_id string, ...) (string, error)
- func (a *API) DeleteFile(bucket, path string) error
- func (a *API) DeleteImage(id string, force bool) error
- func (a *API) DeleteSnapshot(id string, force bool) error
- func (a *API) GetImages(name string) (*ecs.DescribeImagesResponse, error)
- func (a *API) GetImagesByID(id string, region string) (*ecs.DescribeImagesResponse, error)
- func (a *API) ImportImage(...) (string, error)
- func (a *API) ListRegions() ([]string, error)
- func (a *API) PutObject(r io.Reader, bucket, path string, force bool) error
- func (a *API) UploadFile(filepath, bucket, path string, force bool) error
- func (a *API) WaitForImageReady(region_id string, image_id string) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new aliyun API wrapper. It uses credentials from any of the standard credentials sources, including the environment and the profile configured in ~/.aliyun.
func (*API) ChangeVisibility ¶
ChangeVisibility modifies an image uploaded to Aliyun as either public or private. NOTE: only us-east-1 and us-west-1 support making images public unless your account has been allowlisted by Aliyun to operate on all regions
func (*API) CopyImage ¶
func (a *API) CopyImage(source_id, dest_name, dest_region, dest_description, kms_key_id string, encrypted bool, wait_for_ready bool) (string, error)
CopyImage replicates an image to a new region
func (*API) DeleteFile ¶
DeleteFile deletes a file from an OSS bucket
func (*API) DeleteImage ¶
DeleteImage deletes an image and it's underlying snapshots
func (*API) DeleteSnapshot ¶
DeleteSnapshot deletes a snapshot
func (*API) GetImages ¶
func (a *API) GetImages(name string) (*ecs.DescribeImagesResponse, error)
GetImages retrieves a list of images by ImageName
func (*API) GetImagesByID ¶
GetImagesByID retrieves a list of images by ImageId
func (*API) ImportImage ¶
func (a *API) ImportImage(format, bucket, object, image_size, device, name, description, architecture string, force bool) (string, error)
ImportImage attempts to import an image from OSS returning the image_id & error
NOTE: this function will re-use existing images that share the same final name if the name is not unique then provide force to pre-remove any images with the specified name
func (*API) ListRegions ¶
ListRegions lists the enabled regions in aliyun implicitly by the Profile and Region options.
func (*API) UploadFile ¶
UploadFile is a multipart upload, use for larger files
NOTE: this function will return early if an object already exists at the specified path, if it might not be unique provide the force option to skip these checks
type Options ¶
type Options struct { *platform.Options // The aliyun region regional api calls should use Region string // Config file. Defaults to ~/.aliyun/config.json ConfigPath string // The profile to use when resolving credentials, if applicable Profile string // AccessKeyID is the optional access key to use. It will override all other sources AccessKeyID string // SecretKey is the optional secret key to use. It will override all other sources SecretKey string }