marketplace

package
v1.0.0-beta.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Overview

Package marketplace provides methods and message types of the marketplace v2 API.

Index

Constants

View Source
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")
)
View Source
const (
	ListLocalImagesRequestOrderByCreatedAtAsc  = ListLocalImagesRequestOrderBy("created_at_asc")
	ListLocalImagesRequestOrderByCreatedAtDesc = ListLocalImagesRequestOrderBy("created_at_desc")
)
View Source
const (
	ListVersionsRequestOrderByCreatedAtAsc  = ListVersionsRequestOrderBy("created_at_asc")
	ListVersionsRequestOrderByCreatedAtDesc = ListVersionsRequestOrderBy("created_at_desc")
)
View Source
const (
	// Unspecified image type.
	LocalImageTypeUnknownType = LocalImageType("unknown_type")
	// An image type that can be used to create volumes which are managed via the Instance API.
	LocalImageTypeInstanceLocal = LocalImageType("instance_local")
	// An image type that can be used to create volumes which are managed via the Scaleway Block Storage (SBS) API.
	LocalImageTypeInstanceSbs = LocalImageType("instance_sbs")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

This API allows you to find available images for use when launching a Scaleway Instance.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) GetCategory

func (s *API) GetCategory(req *GetCategoryRequest, opts ...scw.RequestOption) (*Category, error)

GetCategory: 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 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 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 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: 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 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 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: Get a list of all available version of an image, specified by its `image_id` (UUID format).

type Category

type Category struct {
	ID string `json:"id"`

	Name string `json:"name"`

	Description string `json:"description"`
}

Category: category.

type GetCategoryRequest

type GetCategoryRequest struct {
	CategoryID string `json:"-"`
}

GetCategoryRequest: get category request.

type GetImageByLabelRequest

type GetImageByLabelRequest struct {
	Label string
}

type GetImageRequest

type GetImageRequest struct {
	// ImageID: display the image name.
	ImageID string `json:"-"`
}

GetImageRequest: get image request.

type GetLocalImageByLabelRequest

type GetLocalImageByLabelRequest struct {
	ImageLabel     string
	Zone           scw.Zone
	CommercialType string
	Type           LocalImageType
}

type GetLocalImageRequest

type GetLocalImageRequest struct {
	LocalImageID string `json:"-"`
}

GetLocalImageRequest: get local image request.

type GetVersionRequest

type GetVersionRequest struct {
	VersionID string `json:"-"`
}

GetVersionRequest: get version request.

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 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: typically an identifier for a distribution (ex. "ubuntu_focal").
	Label string `json:"label"`
}

Image: image.

type ListCategoriesRequest

type ListCategoriesRequest struct {
	PageSize *uint32 `json:"-"`

	Page *int32 `json:"-"`
}

ListCategoriesRequest: list categories request.

type ListCategoriesResponse

type ListCategoriesResponse struct {
	Categories []*Category `json:"categories"`

	TotalCount uint32 `json:"total_count"`
}

ListCategoriesResponse: list categories response.

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:"-"`
}

ListImagesRequest: list images request.

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"`
}

ListImagesResponse: list images response.

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 ListLocalImagesRequest struct {
	// Precisely one of ImageID, VersionID, ImageLabel must be set.
	ImageID *string `json:"image_id,omitempty"`

	// Precisely one of ImageID, VersionID, ImageLabel must be set.
	VersionID *string `json:"version_id,omitempty"`

	PageSize *uint32 `json:"-"`

	Page *int32 `json:"-"`

	// OrderBy: default value: created_at_asc
	OrderBy ListLocalImagesRequestOrderBy `json:"-"`

	// Precisely one of ImageID, VersionID, ImageLabel must be set.
	ImageLabel *string `json:"image_label,omitempty"`

	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone *scw.Zone `json:"-"`

	// Type: default value: unknown_type
	Type LocalImageType `json:"-"`
}

ListLocalImagesRequest: list local images request.

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"`
}

ListLocalImagesResponse: list local images response.

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:"-"`
}

ListVersionsRequest: list versions request.

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"`
}

ListVersionsResponse: list versions response.

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: 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"`

	// Type: type of this local image.
	// Default value: unknown_type
	Type LocalImageType `json:"type"`
}

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 LocalImageType

type LocalImageType string

func (LocalImageType) MarshalJSON

func (enum LocalImageType) MarshalJSON() ([]byte, error)

func (LocalImageType) String

func (enum LocalImageType) String() string

func (*LocalImageType) UnmarshalJSON

func (enum *LocalImageType) UnmarshalJSON(data []byte) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL