marketplace

package
v1.0.0-beta.15 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 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")
)

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 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)

func (*API) GetImage

func (s *API) GetImage(req *GetImageRequest, opts ...scw.RequestOption) (*Image, error)

GetImage: get a specific marketplace image.

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)

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)

func (*API) ListCategories

func (s *API) ListCategories(req *ListCategoriesRequest, opts ...scw.RequestOption) (*ListCategoriesResponse, error)

func (*API) ListImages

func (s *API) ListImages(req *ListImagesRequest, opts ...scw.RequestOption) (*ListImagesResponse, error)

ListImages: list marketplace images.

func (*API) ListLocalImages

func (s *API) ListLocalImages(req *ListLocalImagesRequest, opts ...scw.RequestOption) (*ListLocalImagesResponse, error)

ListLocalImages: list local images from a specific image or version.

func (*API) ListVersions

func (s *API) ListVersions(req *ListVersionsRequest, opts ...scw.RequestOption) (*ListVersionsResponse, error)

type Category

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

	Name string `json:"name"`

	Description string `json:"description"`
}

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 GetLocalImageByLabelRequest

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

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 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 ListCategoriesRequest struct {
	PageSize *uint32 `json:"-"`

	Page *int32 `json:"-"`
}

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 ListLocalImagesRequest struct {
	ImageID *string `json:"-"`

	VersionID *string `json:"-"`

	PageSize *uint32 `json:"-"`

	Page *int32 `json:"-"`
	// OrderBy: default value: created_at_asc
	OrderBy ListLocalImagesRequestOrderBy `json:"-"`

	ImageLabel *string `json:"-"`

	Zone *scw.Zone `json:"-"`
}

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.

Jump to

Keyboard shortcuts

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