Documentation
¶
Overview ¶
Package marketplace provides methods and message types of the marketplace v2 API.
Index ¶
- Constants
- type API
- func (s *API) GetCategory(req *GetCategoryRequest, opts ...scw.RequestOption) (*Category, error)
- func (s *API) GetImage(req *GetImageRequest, opts ...scw.RequestOption) (*Image, error)
- func (s *API) GetImageByLabel(req *GetImageByLabelRequest, opts ...scw.RequestOption) (*Image, error)
- func (s *API) GetLocalImage(req *GetLocalImageRequest, opts ...scw.RequestOption) (*LocalImage, error)
- func (s *API) GetLocalImageByLabel(req *GetLocalImageByLabelRequest, opts ...scw.RequestOption) (*LocalImage, error)
- func (s *API) GetVersion(req *GetVersionRequest, opts ...scw.RequestOption) (*Version, error)
- func (s *API) ListCategories(req *ListCategoriesRequest, opts ...scw.RequestOption) (*ListCategoriesResponse, error)
- func (s *API) ListImages(req *ListImagesRequest, opts ...scw.RequestOption) (*ListImagesResponse, error)
- func (s *API) ListLocalImages(req *ListLocalImagesRequest, opts ...scw.RequestOption) (*ListLocalImagesResponse, error)
- func (s *API) ListVersions(req *ListVersionsRequest, opts ...scw.RequestOption) (*ListVersionsResponse, error)
- type Category
- type GetCategoryRequest
- type GetImageByLabelRequest
- type GetImageRequest
- type GetLocalImageByLabelRequest
- type GetLocalImageRequest
- type GetVersionRequest
- type Image
- type ListCategoriesRequest
- type ListCategoriesResponse
- type ListImagesRequest
- type ListImagesRequestOrderBy
- type ListImagesResponse
- type ListLocalImagesRequest
- type ListLocalImagesRequestOrderBy
- type ListLocalImagesResponse
- type ListVersionsRequest
- type ListVersionsRequestOrderBy
- type ListVersionsResponse
- type LocalImage
- type Version
Constants ¶
const ( ListImagesRequestOrderByNameAsc = ListImagesRequestOrderBy("name_asc") ListImagesRequestOrderByNameDesc = ListImagesRequestOrderBy("name_desc") ListImagesRequestOrderByCreatedAtAsc = ListImagesRequestOrderBy("created_at_asc") ListImagesRequestOrderByCreatedAtDesc = ListImagesRequestOrderBy("created_at_desc") ListImagesRequestOrderByUpdatedAtAsc = ListImagesRequestOrderBy("updated_at_asc") ListImagesRequestOrderByUpdatedAtDesc = ListImagesRequestOrderBy("updated_at_desc") )
const ( ListLocalImagesRequestOrderByCreatedAtAsc = ListLocalImagesRequestOrderBy("created_at_asc") ListLocalImagesRequestOrderByCreatedAtDesc = ListLocalImagesRequestOrderBy("created_at_desc") )
const ( ListVersionsRequestOrderByCreatedAtAsc = ListVersionsRequestOrderBy("created_at_asc") ListVersionsRequestOrderByCreatedAtDesc = ListVersionsRequestOrderBy("created_at_desc") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API: marketplace API.
func (*API) GetCategory ¶
func (s *API) GetCategory(req *GetCategoryRequest, opts ...scw.RequestOption) (*Category, error)
GetCategory: get a specific category. Get information about a specific category of the marketplace catalog, specified by its `category_id` (UUID format).
func (*API) GetImage ¶
func (s *API) GetImage(req *GetImageRequest, opts ...scw.RequestOption) (*Image, error)
GetImage: get a specific marketplace image. Get detailed information about a marketplace image, specified by its `image_id` (UUID format).
func (*API) GetImageByLabel ¶
func (s *API) GetImageByLabel(req *GetImageByLabelRequest, opts ...scw.RequestOption) (*Image, error)
GetImageByLabel returns the image with the given label
func (*API) GetLocalImage ¶
func (s *API) GetLocalImage(req *GetLocalImageRequest, opts ...scw.RequestOption) (*LocalImage, error)
GetLocalImage: get a specific local image by ID. Get detailed information about a local image, including compatible commercial types, supported architecture, labels and the Availability Zone of the image, specified by its `local_image_id` (UUID format).
func (*API) GetLocalImageByLabel ¶
func (s *API) GetLocalImageByLabel(req *GetLocalImageByLabelRequest, opts ...scw.RequestOption) (*LocalImage, error)
GetLocalImageByLabel returns the local image for the given image label in the given zone and compatible with given commercial type
func (*API) GetVersion ¶
func (s *API) GetVersion(req *GetVersionRequest, opts ...scw.RequestOption) (*Version, error)
GetVersion: get a specific image version. Get information such as the name, creation date, last update and published date for an image version specified by its `version_id` (UUID format).
func (*API) ListCategories ¶
func (s *API) ListCategories(req *ListCategoriesRequest, opts ...scw.RequestOption) (*ListCategoriesResponse, error)
ListCategories: list existing image categories. Get a list of all existing categories. The output can be paginated.
func (*API) ListImages ¶
func (s *API) ListImages(req *ListImagesRequest, opts ...scw.RequestOption) (*ListImagesResponse, error)
ListImages: list marketplace images. List all available images on the marketplace, their UUID, CPU architecture and description.
func (*API) ListLocalImages ¶
func (s *API) ListLocalImages(req *ListLocalImagesRequest, opts ...scw.RequestOption) (*ListLocalImagesResponse, error)
ListLocalImages: list local images from a specific image or version. List information about local images in a specific Availability Zone, specified by its `image_id` (UUID format), `version_id` (UUID format) or `image_label`. Only one of these three parameters may be set.
func (*API) ListVersions ¶
func (s *API) ListVersions(req *ListVersionsRequest, opts ...scw.RequestOption) (*ListVersionsResponse, error)
ListVersions: list versions of an Image. Get a list of all available version of an image, specified by its `image_id` (UUID format).
type GetCategoryRequest ¶
type GetCategoryRequest struct {
CategoryID string `json:"-"`
}
type GetImageByLabelRequest ¶
type GetImageByLabelRequest struct {
Label string
}
type GetImageRequest ¶
type GetImageRequest struct { // ImageID: display the image name. ImageID string `json:"-"` }
type GetLocalImageRequest ¶
type GetLocalImageRequest struct {
LocalImageID string `json:"-"`
}
type GetVersionRequest ¶
type GetVersionRequest struct {
VersionID string `json:"-"`
}
type Image ¶
type Image struct { // ID: UUID of this image. ID string `json:"id"` // Name: name of the image. Name string `json:"name"` // Description: text description of this image. Description string `json:"description"` // Logo: URL of this image's logo. Logo string `json:"logo"` // Categories: list of categories this image belongs to. Categories []string `json:"categories"` // CreatedAt: creation date of this image. CreatedAt *time.Time `json:"created_at"` // UpdatedAt: date of the last modification of this image. UpdatedAt *time.Time `json:"updated_at"` // ValidUntil: expiration date of this image. ValidUntil *time.Time `json:"valid_until"` // Label: label of this image. // Typically an identifier for a distribution (ex. "ubuntu_focal"). Label string `json:"label"` }
Image: image.
type ListCategoriesRequest ¶
type ListCategoriesResponse ¶
type ListCategoriesResponse struct { Categories []*Category `json:"categories"` TotalCount uint32 `json:"total_count"` }
func (*ListCategoriesResponse) UnsafeAppend ¶
func (r *ListCategoriesResponse) UnsafeAppend(res interface{}) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListCategoriesResponse) UnsafeGetTotalCount ¶
func (r *ListCategoriesResponse) UnsafeGetTotalCount() uint32
UnsafeGetTotalCount should not be used Internal usage only
type ListImagesRequest ¶
type ListImagesRequest struct { // PageSize: a positive integer lower or equal to 100 to select the number of items to display. PageSize *uint32 `json:"-"` // Page: a positive integer to choose the page to display. Page *int32 `json:"-"` // OrderBy: ordering to use. // Default value: name_asc OrderBy ListImagesRequestOrderBy `json:"-"` // Arch: choose for which machine architecture to return images. Arch *string `json:"-"` // Category: choose the category of images to get. Category *string `json:"-"` // IncludeEol: choose to include end-of-life images. IncludeEol bool `json:"-"` }
type ListImagesRequestOrderBy ¶
type ListImagesRequestOrderBy string
func (ListImagesRequestOrderBy) MarshalJSON ¶
func (enum ListImagesRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListImagesRequestOrderBy) String ¶
func (enum ListImagesRequestOrderBy) String() string
func (*ListImagesRequestOrderBy) UnmarshalJSON ¶
func (enum *ListImagesRequestOrderBy) UnmarshalJSON(data []byte) error
type ListImagesResponse ¶
type ListImagesResponse struct { Images []*Image `json:"images"` TotalCount uint32 `json:"total_count"` }
func (*ListImagesResponse) FindByLabel ¶
func (r *ListImagesResponse) FindByLabel(label string) *Image
FindByLabel returns the first image with the given label in the image list Cannot find an image if it is not in the ListImagesResponse struct Use scw.WithAllPages when listing image to get all images
func (*ListImagesResponse) UnsafeAppend ¶
func (r *ListImagesResponse) UnsafeAppend(res interface{}) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListImagesResponse) UnsafeGetTotalCount ¶
func (r *ListImagesResponse) UnsafeGetTotalCount() uint32
UnsafeGetTotalCount should not be used Internal usage only
type ListLocalImagesRequest ¶
type ListLocalImagesRequestOrderBy ¶
type ListLocalImagesRequestOrderBy string
func (ListLocalImagesRequestOrderBy) MarshalJSON ¶
func (enum ListLocalImagesRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListLocalImagesRequestOrderBy) String ¶
func (enum ListLocalImagesRequestOrderBy) String() string
func (*ListLocalImagesRequestOrderBy) UnmarshalJSON ¶
func (enum *ListLocalImagesRequestOrderBy) UnmarshalJSON(data []byte) error
type ListLocalImagesResponse ¶
type ListLocalImagesResponse struct { LocalImages []*LocalImage `json:"local_images"` TotalCount uint32 `json:"total_count"` }
func (*ListLocalImagesResponse) UnsafeAppend ¶
func (r *ListLocalImagesResponse) UnsafeAppend(res interface{}) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListLocalImagesResponse) UnsafeGetTotalCount ¶
func (r *ListLocalImagesResponse) UnsafeGetTotalCount() uint32
UnsafeGetTotalCount should not be used Internal usage only
type ListVersionsRequest ¶
type ListVersionsRequest struct { ImageID string `json:"-"` PageSize *uint32 `json:"-"` Page *int32 `json:"-"` // OrderBy: default value: created_at_asc OrderBy ListVersionsRequestOrderBy `json:"-"` }
type ListVersionsRequestOrderBy ¶
type ListVersionsRequestOrderBy string
func (ListVersionsRequestOrderBy) MarshalJSON ¶
func (enum ListVersionsRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListVersionsRequestOrderBy) String ¶
func (enum ListVersionsRequestOrderBy) String() string
func (*ListVersionsRequestOrderBy) UnmarshalJSON ¶
func (enum *ListVersionsRequestOrderBy) UnmarshalJSON(data []byte) error
type ListVersionsResponse ¶
type ListVersionsResponse struct { Versions []*Version `json:"versions"` TotalCount uint32 `json:"total_count"` }
func (*ListVersionsResponse) UnsafeAppend ¶
func (r *ListVersionsResponse) UnsafeAppend(res interface{}) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListVersionsResponse) UnsafeGetTotalCount ¶
func (r *ListVersionsResponse) UnsafeGetTotalCount() uint32
UnsafeGetTotalCount should not be used Internal usage only
type LocalImage ¶
type LocalImage struct { // ID: UUID of this local image. // Version you will typically use to define an image in an API call. ID string `json:"id"` // CompatibleCommercialTypes: list of all commercial types that are compatible with this local image. CompatibleCommercialTypes []string `json:"compatible_commercial_types"` // Arch: supported architecture for this local image. Arch string `json:"arch"` // Zone: availability Zone where this local image is available. Zone scw.Zone `json:"zone"` // Label: image label this image belongs to. Label string `json:"label"` }
LocalImage: local image.
func (*LocalImage) IsCompatible ¶
func (li *LocalImage) IsCompatible(commercialType string) bool
IsCompatible returns true if a local image is compatible with the given instance type commercialType should be an uppercase string ex: DEV1-S
type Version ¶
type Version struct { // ID: UUID of this version. ID string `json:"id"` // Name: name of this version. Name string `json:"name"` // CreatedAt: creation date of this image version. CreatedAt *time.Time `json:"created_at"` // UpdatedAt: date of the last modification of this version. UpdatedAt *time.Time `json:"updated_at"` // PublishedAt: date this version was officially published. PublishedAt *time.Time `json:"published_at"` }
Version: version.