Documentation
¶
Index ¶
- type Datacenter
- type Error
- type Image
- type Images
- type SLCommand
- type SLConfig
- type SLImages
- func (img *SLImages) Children(id int) (Images, error)
- func (img *SLImages) CopyToDatacenters(id int, datacenters ...string) error
- func (img *SLImages) DeleteImages(ids ...int) error
- func (img *SLImages) EditImage(id int, fields *Image) error
- func (img *SLImages) ImageByID(id int) (*Image, error)
- func (img *SLImages) Images() (Images, error)
- func (img *SLImages) ImagesByIDs(ids ...int) (Images, error)
- func (img *SLImages) Parent(id int) (*Image, error)
- func (img *SLImages) Transaction(id int) (*Transaction, error)
- func (img *SLImages) WaitReady(id int, d time.Duration) error
- type Tags
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datacenter ¶
type Datacenter struct {
ID int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
StatusID int `json:"statusId,omitempty"`
}
Datacenter represents a Softlayer datacenter.
type Image ¶
type Image struct {
ID int `json:"id,omitempty"`
ParentID int `json:"parentId,omitempty"`
GlobalID string `json:"globalIdentifier,omitempty"`
CreateDate time.Time `json:"createDate,omitempty"`
Name string `json:"name,omitempty"`
Note string `json:"note,omitempty"`
Datacenter *Datacenter `json:"datacenter,omitempty"`
Datacenters []*Datacenter `json:"datacenters,omitempty"`
Tags Tags `json:"-"`
NotTaggable bool `json:"-"`
}
Image
type Images ¶
type Images []*Image
Images defines and represents regions to images
type SLCommand ¶
type SLCommand struct {
*SLImages
}
SLCommand implements the images various interfaces, such as Fetcher, Deleter, Modifier, etc..
func NewCommand ¶
NewCommand returns a new instance of SLCommand
type SLConfig ¶
type SLConfig struct {
Username string `toml:"username" json:"username"`
APIKey string `toml:"api_key" json:"api_key"`
}
SLConfig represents a configuration section of .imagesrc for sl provider.
type SLImages ¶
type SLImages struct {
// contains filtered or unexported fields
}
SLImages is responsible of managing Softlayer Virtual Disk Images.
func (*SLImages) Children ¶
Children returns children images for the one given by the id.
It returns nil Images and nil error if the images has no children.
func (*SLImages) CopyToDatacenters ¶
func (*SLImages) DeleteImages ¶
Delete deletes the given images.
func (*SLImages) Images ¶
Images returns all images. If not images are found, it returns non-nil error.
func (*SLImages) ImagesByIDs ¶
ImagesByIDs looks up all images and then it filters them by the given IDs. If at least one image is not found, it returns non-nil error.
func (*SLImages) Parent ¶
Parent returns a parent image for the one given by the id.
It returns nil Image and nil error if the image has no parent.
func (*SLImages) Transaction ¶
func (img *SLImages) Transaction(id int) (*Transaction, error)
Transaction returns an ongoing transaction for the image given by the id.
It returns non-nil error when querying the service failed. It return nil Transaction and nil error when there are no ongoing transactions.
type Transaction ¶
type Transaction struct {
ID int `json:"id,omitempty"`
}
Transaction represents an ongoing resource transaction.