Documentation
¶
Overview ¶
Package image implements a client library for accessing OpenStack Image V1 service
Images and ImageDetails can be retrieved using the api.
In addition more complex filtering and sort queries can by using the ImageQueryParameters.
Index ¶
- type DetailResponse
- type QueryParameters
- type Response
- type Service
- func (service Service) ImageDetail(id string) (DetailResponse, error)
- func (service Service) Images() (image []Response, err error)
- func (service Service) ImagesDetail() (image []DetailResponse, err error)
- func (service Service) QueryImages(queryParameters QueryParameters) ([]Response, error)
- func (service Service) QueryImagesDetail(queryParameters QueryParameters) ([]DetailResponse, error)
- type SortDirection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DetailResponse ¶
type DetailResponse struct { CheckSum string `json:"checksum"` ContainerFormat string `json:"container_format"` CreatedAt misc.RFC8601DateTime `json:"created_at"` Deleted bool `json:"deleted"` DeletedAt *misc.RFC8601DateTime `json:"deleted_at"` DiskFormat string `json:"disk_format"` ID string `json:"id"` IsPublic bool `json:"is_public"` MinDisk int64 `json:"min_disk"` MinRAM int64 `json:"min_ram"` Name string `json:"name"` Owner *string `json:"owner"` UpdatedAt misc.RFC8601DateTime `json:"updated_at"` Properties map[string]string `json:"properties"` Protected bool `json:"protected"` Status string `json:"status"` Size int64 `json:"size"` VirtualSize *int64 `json:"virtual_size"` // Note: Property exists in OpenStack dev stack payloads but not Helion public cloud. }
DetailResponse is a structure for all properties of an image for a detailed query
type QueryParameters ¶
type QueryParameters struct { Name string Status string ContainerFormat string DiskFormat string MinSize int64 MaxSize int64 SortKey string SortDirection SortDirection Marker string Limit int64 }
QueryParameters is a structure that contains the filter, sort, and paging parameters for an image or imagedetail query.
type Response ¶
type Response struct { CheckSum string `json:"checksum"` ContainerFormat string `json:"container_format"` DiskFormat string `json:"disk_format"` ID string `json:"id"` Name string `json:"name"` Size int64 `json:"size"` }
Response is a structure for all properties of an image for a non detailed query
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a client service that can make requests against a OpenStack version 1 image service. Below is an example on creating an image service and getting images:
imageService := image.ImageService{Client: *http.DefaultClient, TokenId: tokenId, Url: "http://imageservicelocation"} images:= imageService.Images()
func NewService ¶
func NewService(authenticator common.Authenticator) Service
NewService creates a new image service client.
func (Service) ImageDetail ¶
func (service Service) ImageDetail(id string) (DetailResponse, error)
ImageDetail will issue a get request to OpenStack to retrieve the list of images complete with additional details.
func (Service) Images ¶
Images will issue a get request to OpenStack to retrieve the list of images.
func (Service) ImagesDetail ¶
func (service Service) ImagesDetail() (image []DetailResponse, err error)
ImagesDetail will issue a get request to OpenStack to retrieve the list of images complete with additional details.
func (Service) QueryImages ¶
func (service Service) QueryImages(queryParameters QueryParameters) ([]Response, error)
QueryImages will issue a get request with the specified ImageQueryParameters to retrieve the list of images.
func (Service) QueryImagesDetail ¶
func (service Service) QueryImagesDetail(queryParameters QueryParameters) ([]DetailResponse, error)
QueryImagesDetail will issue a get request with the specified QueryParameters to retrieve the list of images with additional details.
type SortDirection ¶
type SortDirection string
SortDirection of the sort, ascending or descending.
const ( // Desc specifies the sort direction to be descending. Desc SortDirection = "desc" // Asc specifies the sort direction to be ascending. Asc SortDirection = "asc" )