registry

package
v1.0.0-beta.23 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 5

Documentation

Overview

Package registry provides methods and message types of the registry v1 API.

Index

Constants

View Source
const (
	ImageStatusUnknown  = ImageStatus("unknown")
	ImageStatusReady    = ImageStatus("ready")
	ImageStatusDeleting = ImageStatus("deleting")
	ImageStatusError    = ImageStatus("error")
	ImageStatusLocked   = ImageStatus("locked")
)
View Source
const (
	ImageVisibilityVisibilityUnknown = ImageVisibility("visibility_unknown")
	ImageVisibilityInherit           = ImageVisibility("inherit")
	ImageVisibilityPublic            = ImageVisibility("public")
	ImageVisibilityPrivate           = ImageVisibility("private")
)
View Source
const (
	ListImagesRequestOrderByCreatedAtAsc  = ListImagesRequestOrderBy("created_at_asc")
	ListImagesRequestOrderByCreatedAtDesc = ListImagesRequestOrderBy("created_at_desc")
	ListImagesRequestOrderByNameAsc       = ListImagesRequestOrderBy("name_asc")
	ListImagesRequestOrderByNameDesc      = ListImagesRequestOrderBy("name_desc")
)
View Source
const (
	ListNamespacesRequestOrderByCreatedAtAsc    = ListNamespacesRequestOrderBy("created_at_asc")
	ListNamespacesRequestOrderByCreatedAtDesc   = ListNamespacesRequestOrderBy("created_at_desc")
	ListNamespacesRequestOrderByDescriptionAsc  = ListNamespacesRequestOrderBy("description_asc")
	ListNamespacesRequestOrderByDescriptionDesc = ListNamespacesRequestOrderBy("description_desc")
	ListNamespacesRequestOrderByNameAsc         = ListNamespacesRequestOrderBy("name_asc")
	ListNamespacesRequestOrderByNameDesc        = ListNamespacesRequestOrderBy("name_desc")
)
View Source
const (
	ListTagsRequestOrderByCreatedAtAsc  = ListTagsRequestOrderBy("created_at_asc")
	ListTagsRequestOrderByCreatedAtDesc = ListTagsRequestOrderBy("created_at_desc")
	ListTagsRequestOrderByNameAsc       = ListTagsRequestOrderBy("name_asc")
	ListTagsRequestOrderByNameDesc      = ListTagsRequestOrderBy("name_desc")
)
View Source
const (
	NamespaceStatusUnknown  = NamespaceStatus("unknown")
	NamespaceStatusReady    = NamespaceStatus("ready")
	NamespaceStatusDeleting = NamespaceStatus("deleting")
	NamespaceStatusError    = NamespaceStatus("error")
	NamespaceStatusLocked   = NamespaceStatus("locked")
)
View Source
const (
	TagStatusUnknown  = TagStatus("unknown")
	TagStatusReady    = TagStatus("ready")
	TagStatusDeleting = TagStatus("deleting")
	TagStatusError    = TagStatus("error")
	TagStatusLocked   = TagStatus("locked")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

Container Registry API.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) CreateNamespace

func (s *API) CreateNamespace(req *CreateNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)

CreateNamespace: Create a new Container Registry namespace. You must specify the namespace name and region in which you want it to be created. Optionally, you can specify the `project_id` and `is_public` in the request payload.

func (*API) DeleteImage

func (s *API) DeleteImage(req *DeleteImageRequest, opts ...scw.RequestOption) (*Image, error)

DeleteImage: Delete a given image. You must specify, in the endpoint, the `region` and `image_id` parameters of the image you want to delete.

func (*API) DeleteNamespace

func (s *API) DeleteNamespace(req *DeleteNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)

DeleteNamespace: Delete a given namespace. You must specify, in the endpoint, the `region` and `namespace_id` parameters of the namespace you want to delete.

func (*API) DeleteTag

func (s *API) DeleteTag(req *DeleteTagRequest, opts ...scw.RequestOption) (*Tag, error)

DeleteTag: Delete a given image tag. You must specify, in the endpoint, the `region` and `tag_id` parameters of the tag you want to delete.

func (*API) GetImage

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

GetImage: Retrieve information about a given container image, specified by its `image_id` and region. Full details about the image, such as `name`, `namespace_id`, `status`, `visibility`, and `size` are returned in the response.

func (*API) GetNamespace

func (s *API) GetNamespace(req *GetNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)

GetNamespace: Retrieve information about a given namespace, specified by its `namespace_id` and region. Full details about the namespace, such as `description`, `project_id`, `status`, `endpoint`, `is_public`, `size`, and `image_count` are returned in the response.

func (*API) GetTag

func (s *API) GetTag(req *GetTagRequest, opts ...scw.RequestOption) (*Tag, error)

GetTag: Retrieve information about a given image tag, specified by its `tag_id` and region. Full details about the tag, such as `name`, `image_id`, `status`, and `digest` are returned in the response.

func (*API) ListImages

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

ListImages: List all images in a specified region. By default, the images listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can also define additional parameters for your query, such as the `namespace_id` and `project_id` parameters.

func (*API) ListNamespaces

func (s *API) ListNamespaces(req *ListNamespacesRequest, opts ...scw.RequestOption) (*ListNamespacesResponse, error)

ListNamespaces: List all namespaces in a specified region. By default, the namespaces listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can also define additional parameters for your query, such as the `instance_id` and `project_id` parameters.

func (*API) ListTags

func (s *API) ListTags(req *ListTagsRequest, opts ...scw.RequestOption) (*ListTagsResponse, error)

ListTags: List all tags for a given image, specified by region. By default, the tags listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can also define additional parameters for your query, such as the `name`.

func (*API) Regions

func (s *API) Regions() []scw.Region

func (*API) UpdateImage

func (s *API) UpdateImage(req *UpdateImageRequest, opts ...scw.RequestOption) (*Image, error)

UpdateImage: Update the parameters of a given image, specified by its `image_id` and `region`. You can update the `visibility` parameter.

func (*API) UpdateNamespace

func (s *API) UpdateNamespace(req *UpdateNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)

UpdateNamespace: Update the parameters of a given namespace, specified by its `namespace_id` and `region`. You can update the `description` and `is_public` parameters.

func (*API) WaitForImage

func (s *API) WaitForImage(req *WaitForImageRequest, opts ...scw.RequestOption) (*Image, error)

WaitForImage wait for the image to be in a "terminal state" before returning. This function can be used to wait for an image to be ready for example.

func (*API) WaitForNamespace

func (s *API) WaitForNamespace(req *WaitForNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)

WaitForNamespace wait for the namespace to be in a "terminal state" before returning. This function can be used to wait for a namespace to be ready for example.

func (*API) WaitForTag

func (s *API) WaitForTag(req *WaitForTagRequest, opts ...scw.RequestOption) (*Tag, error)

WaitForTag wait for the tag to be in a "terminal state" before returning. This function can be used to wait for a tag to be ready for example.

type CreateNamespaceRequest

type CreateNamespaceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Name: name of the namespace.
	Name string `json:"name"`

	// Description: description of the namespace.
	Description string `json:"description"`

	// Deprecated: OrganizationID: namespace owner (deprecated).
	// Precisely one of ProjectID, OrganizationID must be set.
	OrganizationID *string `json:"organization_id,omitempty"`

	// ProjectID: project ID on which the namespace will be created.
	// Precisely one of ProjectID, OrganizationID must be set.
	ProjectID *string `json:"project_id,omitempty"`

	// IsPublic: defines whether or not namespace is public.
	IsPublic bool `json:"is_public"`
}

CreateNamespaceRequest: create namespace request.

type DeleteImageRequest

type DeleteImageRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ImageID: UUID of the image.
	ImageID string `json:"-"`
}

DeleteImageRequest: delete image request.

type DeleteNamespaceRequest

type DeleteNamespaceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// NamespaceID: UUID of the namespace.
	NamespaceID string `json:"-"`
}

DeleteNamespaceRequest: delete namespace request.

type DeleteTagRequest

type DeleteTagRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// TagID: UUID of the tag.
	TagID string `json:"-"`

	// Deprecated: Force: if two tags share the same digest the deletion will fail unless this parameter is set to true (deprecated).
	Force *bool `json:"force,omitempty"`
}

DeleteTagRequest: delete tag request.

type GetImageRequest

type GetImageRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ImageID: UUID of the image.
	ImageID string `json:"-"`
}

GetImageRequest: get image request.

type GetNamespaceRequest

type GetNamespaceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// NamespaceID: UUID of the namespace.
	NamespaceID string `json:"-"`
}

GetNamespaceRequest: get namespace request.

type GetTagRequest

type GetTagRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// TagID: UUID of the tag.
	TagID string `json:"-"`
}

GetTagRequest: get tag request.

type Image

type Image struct {
	// ID: UUID of the image.
	ID string `json:"id"`

	// Name: name of the image, it must be unique within the namespace.
	Name string `json:"name"`

	// NamespaceID: UUID of the namespace the image belongs to.
	NamespaceID string `json:"namespace_id"`

	// Status: status of the image.
	// Default value: unknown
	Status ImageStatus `json:"status"`

	// StatusMessage: details of the image status.
	StatusMessage *string `json:"status_message"`

	// Visibility: set to `public` to allow the image to be pulled without authentication. Else, set to  `private`. Set to `inherit` to keep the same visibility configuration as the namespace.
	// Default value: visibility_unknown
	Visibility ImageVisibility `json:"visibility"`

	// Size: image size in bytes, calculated from the size of image layers. One layer used in two tags of the same image is counted once but one layer used in two images is counted twice.
	Size scw.Size `json:"size"`

	// CreatedAt: date and time of image creation.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: date and time of last update.
	UpdatedAt *time.Time `json:"updated_at"`

	// Tags: list of docker tags of the image.
	Tags []string `json:"tags"`
}

Image: image.

type ImageStatus

type ImageStatus string

func (ImageStatus) MarshalJSON

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

func (ImageStatus) String

func (enum ImageStatus) String() string

func (*ImageStatus) UnmarshalJSON

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

type ImageVisibility

type ImageVisibility string

func (ImageVisibility) MarshalJSON

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

func (ImageVisibility) String

func (enum ImageVisibility) String() string

func (*ImageVisibility) UnmarshalJSON

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

type ListImagesRequest

type ListImagesRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Page: a positive integer to choose the page to display.
	Page *int32 `json:"-"`

	// PageSize: a positive integer lower or equal to 100 to select the number of items to display.
	PageSize *uint32 `json:"-"`

	// OrderBy: criteria to use when ordering image listings. Possible values are `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc`, `region`, `status_asc` and `status_desc`. The default value is `created_at_asc`.
	// Default value: created_at_asc
	OrderBy ListImagesRequestOrderBy `json:"-"`

	// NamespaceID: filter by the namespace ID.
	NamespaceID *string `json:"-"`

	// Name: filter by the image name (exact match).
	Name *string `json:"-"`

	// OrganizationID: filter by Organization ID.
	OrganizationID *string `json:"-"`

	// ProjectID: filter by Project ID.
	ProjectID *string `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: paginated list of images that match the selected filters.
	Images []*Image `json:"images"`

	// TotalCount: total number of images that match the selected filters.
	TotalCount uint32 `json:"total_count"`
}

ListImagesResponse: list images response.

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 ListNamespacesRequest

type ListNamespacesRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Page: a positive integer to choose the page to display.
	Page *int32 `json:"-"`

	// PageSize: a positive integer lower or equal to 100 to select the number of items to display.
	PageSize *uint32 `json:"-"`

	// OrderBy: criteria to use when ordering namespace listings. Possible values are `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc`, `region`, `status_asc` and `status_desc`. The default value is `created_at_asc`.
	// Default value: created_at_asc
	OrderBy ListNamespacesRequestOrderBy `json:"-"`

	// OrganizationID: filter by Organization ID.
	OrganizationID *string `json:"-"`

	// ProjectID: filter by Project ID.
	ProjectID *string `json:"-"`

	// Name: filter by the namespace name (exact match).
	Name *string `json:"-"`
}

ListNamespacesRequest: list namespaces request.

type ListNamespacesRequestOrderBy

type ListNamespacesRequestOrderBy string

func (ListNamespacesRequestOrderBy) MarshalJSON

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

func (ListNamespacesRequestOrderBy) String

func (enum ListNamespacesRequestOrderBy) String() string

func (*ListNamespacesRequestOrderBy) UnmarshalJSON

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

type ListNamespacesResponse

type ListNamespacesResponse struct {
	// Namespaces: paginated list of namespaces that match the selected filters.
	Namespaces []*Namespace `json:"namespaces"`

	// TotalCount: total number of namespaces that match the selected filters.
	TotalCount uint32 `json:"total_count"`
}

ListNamespacesResponse: list namespaces response.

func (*ListNamespacesResponse) UnsafeAppend

func (r *ListNamespacesResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListNamespacesResponse) UnsafeGetTotalCount

func (r *ListNamespacesResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListTagsRequest

type ListTagsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ImageID: UUID of the image.
	ImageID string `json:"-"`

	// Page: a positive integer to choose the page to display.
	Page *int32 `json:"-"`

	// PageSize: a positive integer lower or equal to 100 to select the number of items to display.
	PageSize *uint32 `json:"-"`

	// OrderBy: criteria to use when ordering tag listings. Possible values are `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc`, `region`, `status_asc` and `status_desc`. The default value is `created_at_asc`.
	// Default value: created_at_asc
	OrderBy ListTagsRequestOrderBy `json:"-"`

	// Name: filter by the tag name (exact match).
	Name *string `json:"-"`
}

ListTagsRequest: list tags request.

type ListTagsRequestOrderBy

type ListTagsRequestOrderBy string

func (ListTagsRequestOrderBy) MarshalJSON

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

func (ListTagsRequestOrderBy) String

func (enum ListTagsRequestOrderBy) String() string

func (*ListTagsRequestOrderBy) UnmarshalJSON

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

type ListTagsResponse

type ListTagsResponse struct {
	// Tags: paginated list of tags that match the selected filters.
	Tags []*Tag `json:"tags"`

	// TotalCount: total number of tags that match the selected filters.
	TotalCount uint32 `json:"total_count"`
}

ListTagsResponse: list tags response.

func (*ListTagsResponse) UnsafeAppend

func (r *ListTagsResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListTagsResponse) UnsafeGetTotalCount

func (r *ListTagsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type Namespace

type Namespace struct {
	// ID: UUID of the namespace.
	ID string `json:"id"`

	// Name: name of the namespace, unique in a region accross all organizations.
	Name string `json:"name"`

	// Description: description of the namespace.
	Description string `json:"description"`

	// OrganizationID: owner of the namespace.
	OrganizationID string `json:"organization_id"`

	// ProjectID: project of the namespace.
	ProjectID string `json:"project_id"`

	// Status: namespace status.
	// Default value: unknown
	Status NamespaceStatus `json:"status"`

	// StatusMessage: namespace status details.
	StatusMessage string `json:"status_message"`

	// Endpoint: endpoint reachable by docker.
	Endpoint string `json:"endpoint"`

	// IsPublic: defines whether or not namespace is public.
	IsPublic bool `json:"is_public"`

	// Size: total size of the namespace, calculated as the sum of the size of all images in the namespace.
	Size scw.Size `json:"size"`

	// CreatedAt: date and time of creation.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: date and time of last update.
	UpdatedAt *time.Time `json:"updated_at"`

	// ImageCount: number of images in the namespace.
	ImageCount uint32 `json:"image_count"`

	// Region: region the namespace belongs to.
	Region scw.Region `json:"region"`
}

Namespace: namespace.

type NamespaceStatus

type NamespaceStatus string

func (NamespaceStatus) MarshalJSON

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

func (NamespaceStatus) String

func (enum NamespaceStatus) String() string

func (*NamespaceStatus) UnmarshalJSON

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

type Tag

type Tag struct {
	// ID: UUID of the tag.
	ID string `json:"id"`

	// Name: tag name, unique to an image.
	Name string `json:"name"`

	// ImageID: image ID the of the image the tag belongs to.
	ImageID string `json:"image_id"`

	// Status: tag status.
	// Default value: unknown
	Status TagStatus `json:"status"`

	// Digest: hash of the tag content. Several tags of a same image may have the same digest.
	Digest string `json:"digest"`

	// CreatedAt: date and time of creation.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: date and time of last update.
	UpdatedAt *time.Time `json:"updated_at"`
}

Tag: tag.

type TagStatus

type TagStatus string

func (TagStatus) MarshalJSON

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

func (TagStatus) String

func (enum TagStatus) String() string

func (*TagStatus) UnmarshalJSON

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

type UpdateImageRequest

type UpdateImageRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ImageID: ID of the image to update.
	ImageID string `json:"-"`

	// Visibility: set to `public` to allow the image to be pulled without authentication. Else, set to  `private`. Set to `inherit` to keep the same visibility configuration as the namespace.
	// Default value: visibility_unknown
	Visibility ImageVisibility `json:"visibility"`
}

UpdateImageRequest: update image request.

type UpdateNamespaceRequest

type UpdateNamespaceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// NamespaceID: ID of the namespace to update.
	NamespaceID string `json:"-"`

	// Description: namespace description.
	Description *string `json:"description,omitempty"`

	// IsPublic: defines whether or not the namespace is public.
	IsPublic *bool `json:"is_public,omitempty"`
}

UpdateNamespaceRequest: update namespace request.

type WaitForImageRequest

type WaitForImageRequest struct {
	ImageID       string
	Region        scw.Region
	Timeout       *time.Duration
	RetryInterval *time.Duration
}

WaitForNamespaceRequest is used by WaitForNamespace method

type WaitForNamespaceRequest

type WaitForNamespaceRequest struct {
	NamespaceID   string
	Region        scw.Region
	Timeout       *time.Duration
	RetryInterval *time.Duration
}

WaitForNamespaceRequest is used by WaitForNamespace method

type WaitForTagRequest

type WaitForTagRequest struct {
	TagID         string
	Region        scw.Region
	Timeout       *time.Duration
	RetryInterval *time.Duration
}

WaitForTagRequest is used by WaitForTag method

Jump to

Keyboard shortcuts

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