Skip to content

Commit c44d71e

Browse files
authored
docs(registry): fix documentation (#1645)
1 parent f090cd8 commit c44d71e

File tree

1 file changed

+65
-62
lines changed

1 file changed

+65
-62
lines changed

api/registry/v1/registry_sdk.go

Lines changed: 65 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ var (
3939
_ = namegenerator.GetRandomName
4040
)
4141

42-
// API: container registry API.
43-
// Registry API.
42+
// API: container Registry API.
4443
type API struct {
4544
client *scw.Client
4645
}
@@ -283,58 +282,58 @@ func (enum *TagStatus) UnmarshalJSON(data []byte) error {
283282

284283
// Image: image.
285284
type Image struct {
286-
// ID: the unique ID of the Image.
285+
// ID: the UUID of the image.
287286
ID string `json:"id"`
288-
// Name: the Image name, unique in a namespace.
287+
// Name: the name of the image, it must be unique within the namespace.
289288
Name string `json:"name"`
290-
// NamespaceID: the unique ID of the Namespace the image belongs to.
289+
// NamespaceID: the UUID of the namespace the image belongs to.
291290
NamespaceID string `json:"namespace_id"`
292291
// Status: the status of the image.
293292
// Default value: unknown
294293
Status ImageStatus `json:"status"`
295294
// StatusMessage: details of the image status.
296295
StatusMessage *string `json:"status_message"`
297-
// Visibility: a `public` image is pullable from internet without authentication, opposed to a `private` image. `inherit` will use the namespace `is_public` parameter.
296+
// 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.
298297
// Default value: visibility_unknown
299298
Visibility ImageVisibility `json:"visibility"`
300299
// Size: image size in bytes, calculated from the size of image layers.
301300
// 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.
302301
Size scw.Size `json:"size"`
303-
// CreatedAt: creation date.
302+
// CreatedAt: date and time of image creation.
304303
CreatedAt *time.Time `json:"created_at"`
305-
// UpdatedAt: last modification date, from the user or the service.
304+
// UpdatedAt: date and time of last update.
306305
UpdatedAt *time.Time `json:"updated_at"`
307306
// Tags: list of docker tags of the image.
308307
Tags []string `json:"tags"`
309308
}
310309

311310
// ListImagesResponse: list images response.
312311
type ListImagesResponse struct {
313-
// Images: paginated list of images matching filters.
312+
// Images: paginated list of images that match the selected filters.
314313
Images []*Image `json:"images"`
315-
// TotalCount: total number of images matching filters.
314+
// TotalCount: total number of images that match the selected filters.
316315
TotalCount uint32 `json:"total_count"`
317316
}
318317

319318
// ListNamespacesResponse: list namespaces response.
320319
type ListNamespacesResponse struct {
321-
// Namespaces: paginated list of namespaces matching filters.
320+
// Namespaces: paginated list of namespaces that match the selected filters.
322321
Namespaces []*Namespace `json:"namespaces"`
323-
// TotalCount: total number of namespaces matching filters.
322+
// TotalCount: total number of namespaces that match the selected filters.
324323
TotalCount uint32 `json:"total_count"`
325324
}
326325

327326
// ListTagsResponse: list tags response.
328327
type ListTagsResponse struct {
329-
// Tags: paginated list of tags matching filters.
328+
// Tags: paginated list of tags that match the selected filters.
330329
Tags []*Tag `json:"tags"`
331-
// TotalCount: total number of tags matching filters.
330+
// TotalCount: total number of tags that match the selected filters.
332331
TotalCount uint32 `json:"total_count"`
333332
}
334333

335334
// Namespace: namespace.
336335
type Namespace struct {
337-
// ID: the unique ID of the namespace.
336+
// ID: the UUID of the namespace.
338337
ID string `json:"id"`
339338
// Name: the name of the namespace, unique in a region accross all organizations.
340339
Name string `json:"name"`
@@ -351,13 +350,13 @@ type Namespace struct {
351350
StatusMessage string `json:"status_message"`
352351
// Endpoint: endpoint reachable by docker.
353352
Endpoint string `json:"endpoint"`
354-
// IsPublic: namespace visibility policy.
353+
// IsPublic: whether or not namespace is public.
355354
IsPublic bool `json:"is_public"`
356355
// Size: total size of the namespace, calculated as the sum of the size of all images in the namespace.
357356
Size scw.Size `json:"size"`
358-
// CreatedAt: creation date.
357+
// CreatedAt: date and time of creation.
359358
CreatedAt *time.Time `json:"created_at"`
360-
// UpdatedAt: last modification date, from the user or the service.
359+
// UpdatedAt: date and time of last update.
361360
UpdatedAt *time.Time `json:"updated_at"`
362361
// ImageCount: number of images in the namespace.
363362
ImageCount uint32 `json:"image_count"`
@@ -367,20 +366,20 @@ type Namespace struct {
367366

368367
// Tag: tag.
369368
type Tag struct {
370-
// ID: the unique ID of the tag.
369+
// ID: the UUID of the tag.
371370
ID string `json:"id"`
372-
// Name: tag name, unique for an image.
371+
// Name: tag name, unique to an image.
373372
Name string `json:"name"`
374-
// ImageID: image ID this tag belongs to.
373+
// ImageID: image ID the of the image the tag belongs to.
375374
ImageID string `json:"image_id"`
376375
// Status: tag status.
377376
// Default value: unknown
378377
Status TagStatus `json:"status"`
379-
// Digest: hash of the tag actual content. Several tags of a same image may have the same digest.
378+
// Digest: hash of the tag content. Several tags of a same image may have the same digest.
380379
Digest string `json:"digest"`
381-
// CreatedAt: creation date.
380+
// CreatedAt: date and time of creation.
382381
CreatedAt *time.Time `json:"created_at"`
383-
// UpdatedAt: last modification date, from the user or the service.
382+
// UpdatedAt: date and time of last update.
384383
UpdatedAt *time.Time `json:"updated_at"`
385384
}
386385

@@ -398,7 +397,7 @@ type ListNamespacesRequest struct {
398397
Page *int32 `json:"-"`
399398
// PageSize: a positive integer lower or equal to 100 to select the number of items to display.
400399
PageSize *uint32 `json:"-"`
401-
// OrderBy: field by which to order the display of Images.
400+
// 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`.
402401
// Default value: created_at_asc
403402
OrderBy ListNamespacesRequestOrderBy `json:"-"`
404403
// OrganizationID: filter by Organization ID.
@@ -409,7 +408,8 @@ type ListNamespacesRequest struct {
409408
Name *string `json:"-"`
410409
}
411410

412-
// ListNamespaces: list all your namespaces.
411+
// ListNamespaces: list namespaces.
412+
// 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.
413413
func (s *API) ListNamespaces(req *ListNamespacesRequest, opts ...scw.RequestOption) (*ListNamespacesResponse, error) {
414414
var err error
415415

@@ -454,12 +454,12 @@ func (s *API) ListNamespaces(req *ListNamespacesRequest, opts ...scw.RequestOpti
454454
type GetNamespaceRequest struct {
455455
// Region: region to target. If none is passed will use default region from the config.
456456
Region scw.Region `json:"-"`
457-
// NamespaceID: the unique ID of the Namespace.
457+
// NamespaceID: the UUID of the namespace.
458458
NamespaceID string `json:"-"`
459459
}
460460

461461
// GetNamespace: get a namespace.
462-
// Get the namespace associated with the given id.
462+
// 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.
463463
func (s *API) GetNamespace(req *GetNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error) {
464464
var err error
465465

@@ -494,21 +494,22 @@ func (s *API) GetNamespace(req *GetNamespaceRequest, opts ...scw.RequestOption)
494494
type CreateNamespaceRequest struct {
495495
// Region: region to target. If none is passed will use default region from the config.
496496
Region scw.Region `json:"-"`
497-
// Name: define a namespace name.
497+
// Name: name of the namespace.
498498
Name string `json:"name"`
499-
// Description: define a description.
499+
// Description: description of the namespace.
500500
Description string `json:"description"`
501-
// Deprecated: OrganizationID: assign the namespace owner (deprecated).
501+
// Deprecated: OrganizationID: namespace owner (deprecated).
502502
// Precisely one of OrganizationID, ProjectID must be set.
503503
OrganizationID *string `json:"organization_id,omitempty"`
504-
// ProjectID: assign the namespace to a project ID.
504+
// ProjectID: project ID on which the namespace will be created.
505505
// Precisely one of OrganizationID, ProjectID must be set.
506506
ProjectID *string `json:"project_id,omitempty"`
507-
// IsPublic: define the default visibility policy.
507+
// IsPublic: whether or not namespace is public.
508508
IsPublic bool `json:"is_public"`
509509
}
510510

511-
// CreateNamespace: create a new namespace.
511+
// CreateNamespace: create a namespace.
512+
// 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.
512513
func (s *API) CreateNamespace(req *CreateNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error) {
513514
var err error
514515

@@ -558,16 +559,16 @@ func (s *API) CreateNamespace(req *CreateNamespaceRequest, opts ...scw.RequestOp
558559
type UpdateNamespaceRequest struct {
559560
// Region: region to target. If none is passed will use default region from the config.
560561
Region scw.Region `json:"-"`
561-
// NamespaceID: namespace ID to update.
562+
// NamespaceID: ID of the namespace to update.
562563
NamespaceID string `json:"-"`
563-
// Description: define a description.
564+
// Description: namespace description.
564565
Description *string `json:"description"`
565-
// IsPublic: define the default visibility policy.
566+
// IsPublic: whether or not the namespace is public.
566567
IsPublic *bool `json:"is_public"`
567568
}
568569

569-
// UpdateNamespace: update an existing namespace.
570-
// Update the namespace associated with the given id.
570+
// UpdateNamespace: update a namespace.
571+
// Update the parameters of a given namespace, specified by its `namespace_id` and `region`. You can update the `description` and `is_public` parameters.
571572
func (s *API) UpdateNamespace(req *UpdateNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error) {
572573
var err error
573574

@@ -607,12 +608,12 @@ func (s *API) UpdateNamespace(req *UpdateNamespaceRequest, opts ...scw.RequestOp
607608
type DeleteNamespaceRequest struct {
608609
// Region: region to target. If none is passed will use default region from the config.
609610
Region scw.Region `json:"-"`
610-
// NamespaceID: the unique ID of the Namespace.
611+
// NamespaceID: the UUID of the namespace.
611612
NamespaceID string `json:"-"`
612613
}
613614

614-
// DeleteNamespace: delete an existing namespace.
615-
// Delete the namespace associated with the given id.
615+
// DeleteNamespace: delete a namespace.
616+
// Delete a given namespace. You must specify, in the endpoint, the `region` and `namespace_id` parameters of the namespace you want to delete.
616617
func (s *API) DeleteNamespace(req *DeleteNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error) {
617618
var err error
618619

@@ -651,20 +652,21 @@ type ListImagesRequest struct {
651652
Page *int32 `json:"-"`
652653
// PageSize: a positive integer lower or equal to 100 to select the number of items to display.
653654
PageSize *uint32 `json:"-"`
654-
// OrderBy: field by which to order the display of Images.
655+
// 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`.
655656
// Default value: created_at_asc
656657
OrderBy ListImagesRequestOrderBy `json:"-"`
657-
// NamespaceID: filter by the Namespace ID.
658+
// NamespaceID: filter by the namespace ID.
658659
NamespaceID *string `json:"-"`
659-
// Name: filter by the Image name (exact match).
660+
// Name: filter by the image name (exact match).
660661
Name *string `json:"-"`
661662
// OrganizationID: filter by Organization ID.
662663
OrganizationID *string `json:"-"`
663664
// ProjectID: filter by Project ID.
664665
ProjectID *string `json:"-"`
665666
}
666667

667-
// ListImages: list all your images.
668+
// ListImages: list images.
669+
// 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.
668670
func (s *API) ListImages(req *ListImagesRequest, opts ...scw.RequestOption) (*ListImagesResponse, error) {
669671
var err error
670672

@@ -710,12 +712,12 @@ func (s *API) ListImages(req *ListImagesRequest, opts ...scw.RequestOption) (*Li
710712
type GetImageRequest struct {
711713
// Region: region to target. If none is passed will use default region from the config.
712714
Region scw.Region `json:"-"`
713-
// ImageID: the unique ID of the Image.
715+
// ImageID: the UUID of the image.
714716
ImageID string `json:"-"`
715717
}
716718

717-
// GetImage: get a image.
718-
// Get the image associated with the given id.
719+
// GetImage: get an image.
720+
// 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.
719721
func (s *API) GetImage(req *GetImageRequest, opts ...scw.RequestOption) (*Image, error) {
720722
var err error
721723

@@ -750,15 +752,15 @@ func (s *API) GetImage(req *GetImageRequest, opts ...scw.RequestOption) (*Image,
750752
type UpdateImageRequest struct {
751753
// Region: region to target. If none is passed will use default region from the config.
752754
Region scw.Region `json:"-"`
753-
// ImageID: image ID to update.
755+
// ImageID: ID of the image to update.
754756
ImageID string `json:"-"`
755-
// Visibility: a `public` image is pullable from internet without authentication, opposed to a `private` image. `inherit` will use the namespace `is_public` parameter.
757+
// 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.
756758
// Default value: visibility_unknown
757759
Visibility ImageVisibility `json:"visibility"`
758760
}
759761

760-
// UpdateImage: update an existing image.
761-
// Update the image associated with the given id.
762+
// UpdateImage: update an image.
763+
// Update the parameters of a given image, specified by its `image_id` and `region`. You can update the `visibility` parameter.
762764
func (s *API) UpdateImage(req *UpdateImageRequest, opts ...scw.RequestOption) (*Image, error) {
763765
var err error
764766

@@ -798,12 +800,12 @@ func (s *API) UpdateImage(req *UpdateImageRequest, opts ...scw.RequestOption) (*
798800
type DeleteImageRequest struct {
799801
// Region: region to target. If none is passed will use default region from the config.
800802
Region scw.Region `json:"-"`
801-
// ImageID: the unique ID of the Image.
803+
// ImageID: the UUID of the image.
802804
ImageID string `json:"-"`
803805
}
804806

805807
// DeleteImage: delete an image.
806-
// Delete the image associated with the given id.
808+
// Delete a given image. You must specify, in the endpoint, the `region` and `image_id` parameters of the image you want to delete.
807809
func (s *API) DeleteImage(req *DeleteImageRequest, opts ...scw.RequestOption) (*Image, error) {
808810
var err error
809811

@@ -838,20 +840,21 @@ func (s *API) DeleteImage(req *DeleteImageRequest, opts ...scw.RequestOption) (*
838840
type ListTagsRequest struct {
839841
// Region: region to target. If none is passed will use default region from the config.
840842
Region scw.Region `json:"-"`
841-
// ImageID: the unique ID of the image.
843+
// ImageID: the UUID of the image.
842844
ImageID string `json:"-"`
843845
// Page: a positive integer to choose the page to display.
844846
Page *int32 `json:"-"`
845847
// PageSize: a positive integer lower or equal to 100 to select the number of items to display.
846848
PageSize *uint32 `json:"-"`
847-
// OrderBy: field by which to order the display of Images.
849+
// 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`.
848850
// Default value: created_at_asc
849851
OrderBy ListTagsRequestOrderBy `json:"-"`
850852
// Name: filter by the tag name (exact match).
851853
Name *string `json:"-"`
852854
}
853855

854-
// ListTags: list all your tags.
856+
// ListTags: list tags.
857+
// 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`.
855858
func (s *API) ListTags(req *ListTagsRequest, opts ...scw.RequestOption) (*ListTagsResponse, error) {
856859
var err error
857860

@@ -898,12 +901,12 @@ func (s *API) ListTags(req *ListTagsRequest, opts ...scw.RequestOption) (*ListTa
898901
type GetTagRequest struct {
899902
// Region: region to target. If none is passed will use default region from the config.
900903
Region scw.Region `json:"-"`
901-
// TagID: the unique ID of the Tag.
904+
// TagID: the UUID of the tag.
902905
TagID string `json:"-"`
903906
}
904907

905908
// GetTag: get a tag.
906-
// Get the tag associated with the given id.
909+
// 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.
907910
func (s *API) GetTag(req *GetTagRequest, opts ...scw.RequestOption) (*Tag, error) {
908911
var err error
909912

@@ -938,14 +941,14 @@ func (s *API) GetTag(req *GetTagRequest, opts ...scw.RequestOption) (*Tag, error
938941
type DeleteTagRequest struct {
939942
// Region: region to target. If none is passed will use default region from the config.
940943
Region scw.Region `json:"-"`
941-
// TagID: the unique ID of the tag.
944+
// TagID: the UUID of the tag.
942945
TagID string `json:"-"`
943946
// Force: if two tags share the same digest the deletion will fail unless this parameter is set to true.
944947
Force bool `json:"-"`
945948
}
946949

947950
// DeleteTag: delete a tag.
948-
// Delete the tag associated with the given id.
951+
// Delete a given image tag. You must specify, in the endpoint, the `region` and `tag_id` parameters of the tag you want to delete.
949952
func (s *API) DeleteTag(req *DeleteTagRequest, opts ...scw.RequestOption) (*Tag, error) {
950953
var err error
951954

0 commit comments

Comments
 (0)