Container Registry API, gRPC: LifecyclePolicyService
A set of methods for managing Lifecycle policy resources.
Call | Description |
---|---|
Get | Returns the specified lifecycle policy. |
List | Retrieves the list of lifecycle policies in the specified repository. |
Create | Creates a lifecycle policy in the specified repository. |
Update | Updates the specified lifecycle policy. |
Delete | Deletes the specified lifecycle policy. |
DryRun | Creates a request of a dry run of the lifecycle policy. |
GetDryRunResult | Returns the dry run result of the specified lifecycle policy. |
ListDryRunResults | Retrieves the list of the dry run results. |
ListDryRunResultAffectedImages | Retrieves the list of the affected images. |
Calls LifecyclePolicyService
Get
Returns the specified lifecycle policy.
To get the list of all available lifecycle policies, make a List request.
rpc Get (GetLifecyclePolicyRequest) returns (LifecyclePolicy)
GetLifecyclePolicyRequest
Field | Description |
---|---|
lifecycle_policy_id | string Required. ID of the lifecycle policy. The maximum string length in characters is 50. |
LifecyclePolicy
Field | Description |
---|---|
id | string ID of the lifecycle policy. |
name | string Name of the lifecycle policy. |
repository_id | string ID of the repository that the lifecycle policy belongs to. Required. The maximum string length in characters is 50. |
description | string Description of the lifecycle policy. The maximum string length in characters is 256. |
status | enum Status Status of lifecycle policy.
|
created_at | google.protobuf.Timestamp Creation timestamp. |
rules[] | LifecycleRule The rules of lifecycle policy. |
LifecycleRule
Field | Description |
---|---|
description | string Description of the lifecycle policy rule. The maximum string length in characters is 256. |
expire_period | google.protobuf.Duration Period of time for automatic deletion. Period must be a multiple of 24 hours. The minimum value is 24h. |
tag_regexp | string Tag for specifying a filter in the form of a regular expression. The maximum string length in characters is 256. |
untagged | bool Tag for applying the rule to Docker images without tags. |
retained_top | int64 Number of Docker images (falling under the specified filter by tags) that must be left, even if the expire_period has already expired. The minimum value is 0. |
List
Retrieves the list of lifecycle policies in the specified repository.
rpc List (ListLifecyclePoliciesRequest) returns (ListLifecyclePoliciesResponse)
ListLifecyclePoliciesRequest
Field | Description |
---|---|
id | oneof: registry_id or repository_id |
registry_id | string ID of the lifecycle policy. The maximum string length in characters is 50. |
repository_id | string Repository of the lifecycle policy. The maximum string length in characters is 50. |
page_size | int64 The maximum number of results per page to return. If the number of available results is larger than page_size , the service returns a ListLifecyclePoliciesResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100. Acceptable values are 0 to 1000, inclusive. |
page_token | string Page token. To get the next page of results, set page_token to the ListLifecyclePoliciesResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100. |
filter | string A filter expression that filters lifecycle policy resources listed in the response. The expression must specify:
|
order_by | string Sorting the list by LifecyclePolicy.name, LifecyclePolicy.created_at and LifecyclePolicy.status fields. The default sorting order is ascending. The maximum string length in characters is 100. |
ListLifecyclePoliciesResponse
Field | Description |
---|---|
lifecycle_policies[] | LifecyclePolicy List of lifecycle policies. |
next_page_token | string Token for getting the next page of the list. If the number of results is greater than the specified ListLifecyclePoliciesRequest.page_size, use next_page_token as the value for the ListLifecyclePoliciesRequest.page_token parameter in the next list request. Each subsequent page will have its own next_page_token to continue paging through the results. |
LifecyclePolicy
Field | Description |
---|---|
id | string ID of the lifecycle policy. |
name | string Name of the lifecycle policy. |
repository_id | string ID of the repository that the lifecycle policy belongs to. Required. The maximum string length in characters is 50. |
description | string Description of the lifecycle policy. The maximum string length in characters is 256. |
status | enum Status Status of lifecycle policy.
|
created_at | google.protobuf.Timestamp Creation timestamp. |
rules[] | LifecycleRule The rules of lifecycle policy. |
LifecycleRule
Field | Description |
---|---|
description | string Description of the lifecycle policy rule. The maximum string length in characters is 256. |
expire_period | google.protobuf.Duration Period of time for automatic deletion. Period must be a multiple of 24 hours. The minimum value is 24h. |
tag_regexp | string Tag for specifying a filter in the form of a regular expression. The maximum string length in characters is 256. |
untagged | bool Tag for applying the rule to Docker images without tags. |
retained_top | int64 Number of Docker images (falling under the specified filter by tags) that must be left, even if the expire_period has already expired. The minimum value is 0. |
Create
Creates a lifecycle policy in the specified repository.
rpc Create (CreateLifecyclePolicyRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:CreateLifecyclePolicyMetadata
Operation.response:LifecyclePolicy
CreateLifecyclePolicyRequest
Field | Description |
---|---|
repository_id | string Required. ID of the lifecycle policy repository. The maximum string length in characters is 50. |
name | string Name of lifecycle policy. Value must match the regular expression |[a-z][-a-z0-9]{1,61}[a-z0-9] . |
description | string Description of lifecycle policy. The maximum string length in characters is 256. |
status | LifecyclePolicy.Status Required. Status of the lifecycle policy. |
rules[] | LifecycleRule The rules of the lifecycle policy. |
LifecycleRule
Field | Description |
---|---|
description | string Description of the lifecycle policy rule. The maximum string length in characters is 256. |
expire_period | google.protobuf.Duration Period of time for automatic deletion. Period must be a multiple of 24 hours. The minimum value is 24h. |
tag_regexp | string Tag for specifying a filter in the form of a regular expression. The maximum string length in characters is 256. |
untagged | bool Tag for applying the rule to Docker images without tags. |
retained_top | int64 Number of Docker images (falling under the specified filter by tags) that must be left, even if the expire_period has already expired. The minimum value is 0. |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
CreateLifecyclePolicyMetadata
Field | Description |
---|---|
lifecycle_policy_id | string ID of the lifecycle policy resource that is being created. |
LifecyclePolicy
Field | Description |
---|---|
id | string ID of the lifecycle policy. |
name | string Name of the lifecycle policy. |
repository_id | string ID of the repository that the lifecycle policy belongs to. Required. The maximum string length in characters is 50. |
description | string Description of the lifecycle policy. The maximum string length in characters is 256. |
status | enum Status Status of lifecycle policy.
|
created_at | google.protobuf.Timestamp Creation timestamp. |
rules[] | LifecycleRule The rules of lifecycle policy. |
Update
Updates the specified lifecycle policy.
rpc Update (UpdateLifecyclePolicyRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:UpdateLifecyclePolicyMetadata
Operation.response:LifecyclePolicy
UpdateLifecyclePolicyRequest
Field | Description |
---|---|
lifecycle_policy_id | string Required. ID of the lifecycle policy. The maximum string length in characters is 50. |
update_mask | google.protobuf.FieldMask Field mask that specifies which fields of the lifecycle policy resource are going to be updated. |
name | string Name of lifecycle policy. Value must match the regular expression |[a-z][-a-z0-9]{1,61}[a-z0-9] . |
description | string Description of lifecycle policy. The maximum string length in characters is 256. |
status | LifecyclePolicy.Status Required. Status of the lifecycle policy. |
rules[] | LifecycleRule The rules of the lifecycle policy. |
LifecycleRule
Field | Description |
---|---|
description | string Description of the lifecycle policy rule. The maximum string length in characters is 256. |
expire_period | google.protobuf.Duration Period of time for automatic deletion. Period must be a multiple of 24 hours. The minimum value is 24h. |
tag_regexp | string Tag for specifying a filter in the form of a regular expression. The maximum string length in characters is 256. |
untagged | bool Tag for applying the rule to Docker images without tags. |
retained_top | int64 Number of Docker images (falling under the specified filter by tags) that must be left, even if the expire_period has already expired. The minimum value is 0. |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
UpdateLifecyclePolicyMetadata
Field | Description |
---|---|
lifecycle_policy_id | string ID of the lifecycle policy resource that is being updated. |
LifecyclePolicy
Field | Description |
---|---|
id | string ID of the lifecycle policy. |
name | string Name of the lifecycle policy. |
repository_id | string ID of the repository that the lifecycle policy belongs to. Required. The maximum string length in characters is 50. |
description | string Description of the lifecycle policy. The maximum string length in characters is 256. |
status | enum Status Status of lifecycle policy.
|
created_at | google.protobuf.Timestamp Creation timestamp. |
rules[] | LifecycleRule The rules of lifecycle policy. |
Delete
Deletes the specified lifecycle policy.
rpc Delete (DeleteLifecyclePolicyRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:DeleteLifecyclePolicyMetadata
Operation.response:google.protobuf.Empty
DeleteLifecyclePolicyRequest
Field | Description |
---|---|
lifecycle_policy_id | string Required. ID of the lifecycle policy. The maximum string length in characters is 50. |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
DeleteLifecyclePolicyMetadata
Field | Description |
---|---|
lifecycle_policy_id | string ID of the lifecycle policy resource that is being deleted. |
DryRun
Creates a request of a dry run of the lifecycle policy.
rpc DryRun (DryRunLifecyclePolicyRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:DryRunLifecyclePolicyMetadata
Operation.response:DryRunLifecyclePolicyResult
DryRunLifecyclePolicyRequest
Field | Description |
---|---|
lifecycle_policy_id | string Required. ID of the lifecycle policy. The maximum string length in characters is 50. |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
DryRunLifecyclePolicyMetadata
Field | Description |
---|---|
dry_run_lifecycle_policy_result_id | string ID of the dry run result of the lifecycle policy. |
lifecycle_policy_id | string ID of the lifecycle policy. |
DryRunLifecyclePolicyResult
Field | Description |
---|---|
dry_run_lifecycle_policy_result_id | string ID of the dry run result of the lifecycle policy. |
lifecycle_policy_id | string ID of the lifecycle policy. |
run_at | google.protobuf.Timestamp Time of the getting result. |
affected_images_count | int64 Count of affected images. |
GetDryRunResult
Returns the dry run result of the specified lifecycle policy.
rpc GetDryRunResult (GetDryRunLifecyclePolicyResultRequest) returns (DryRunLifecyclePolicyResult)
GetDryRunLifecyclePolicyResultRequest
Field | Description |
---|---|
dry_run_lifecycle_policy_result_id | string Required. ID of the dry run result of the lifecycle policy. The maximum string length in characters is 50. |
DryRunLifecyclePolicyResult
Field | Description |
---|---|
dry_run_lifecycle_policy_result_id | string ID of the dry run result of the lifecycle policy. |
lifecycle_policy_id | string ID of the lifecycle policy. |
run_at | google.protobuf.Timestamp Time of the getting result. |
affected_images_count | int64 Count of affected images. |
ListDryRunResults
Retrieves the list of the dry run results.
rpc ListDryRunResults (ListDryRunLifecyclePolicyResultsRequest) returns (ListDryRunLifecyclePolicyResultsResponse)
ListDryRunLifecyclePolicyResultsRequest
Field | Description |
---|---|
lifecycle_policy_id | string Required. ID of the lifecycle policy. The maximum string length in characters is 50. |
page_size | int64 The maximum number of results per page to return. If the number of available results is larger than page_size , the service returns a ListDryRunLifecyclePolicyResultsResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 1000, inclusive. |
page_token | string Page token. To get the next page of results, set page_token to the ListDryRunLifecyclePolicyResultsResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100. |
filter | string A filter expression that filters dry run results listed in the response. The expression must specify:
|
order_by | string Sorting the list by DryRunLifecyclePolicyResult.run_at and DryRunLifecyclePolicyResult.affected_images_count fields. The default sorting order is ascending. The maximum string length in characters is 100. |
ListDryRunLifecyclePolicyResultsResponse
Field | Description |
---|---|
dry_run_lifecycle_policy_results[] | DryRunLifecyclePolicyResult List of results of dry runs of a lifecycle policy. |
next_page_token | string Token for getting the next page of the list. If the number of results is greater than the specified ListDryRunLifecyclePolicyResultsRequest.page_size use next_page_token as the value for the ListDryRunLifecyclePolicyResultsRequest.page_token parameter in the next list request. Each subsequent page will have its own next_page_token to continue paging through the results. |
DryRunLifecyclePolicyResult
Field | Description |
---|---|
dry_run_lifecycle_policy_result_id | string ID of the dry run result of the lifecycle policy. |
lifecycle_policy_id | string ID of the lifecycle policy. |
run_at | google.protobuf.Timestamp Time of the getting result. |
affected_images_count | int64 Count of affected images. |
ListDryRunResultAffectedImages
Retrieves the list of the affected images.
rpc ListDryRunResultAffectedImages (ListDryRunLifecyclePolicyResultAffectedImagesRequest) returns (ListDryRunLifecyclePolicyResultAffectedImagesResponse)
ListDryRunLifecyclePolicyResultAffectedImagesRequest
Field | Description |
---|---|
dry_run_lifecycle_policy_result_id | string Required. ID of the dry run result of the lifecycle policy The maximum string length in characters is 50. |
page_size | int64 The maximum number of results per page to return. If the number of available results is larger than page_size , the service returns a ListDryRunLifecyclePolicyResultAffectedImagesResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 1000, inclusive. |
page_token | string Page token. To get the next page of results, set page_token to the ListDryRunLifecyclePolicyResultAffectedImagesResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100. |
filter | string A filter expression that filters affected images listed in the response. The expression must specify:
|
order_by | string Sorting the list by LifecyclePolicy.name and LifecyclePolicy.created_at fields. The default sorting order is ascending. The maximum string length in characters is 100. |
ListDryRunLifecyclePolicyResultAffectedImagesResponse
Field | Description |
---|---|
affected_images[] | Image List of affected images. |
next_page_token | string Token for getting the next page of the list. If the number of results is greater than the specified ListDryRunLifecyclePolicyResultAffectedImagesRequest.page_size, use next_page_token as the value for the ListDryRunLifecyclePolicyResultAffectedImagesRequest.page_token parameter in the next list request. Each subsequent page will have its own next_page_token to continue paging through the results. |
Image
Field | Description |
---|---|
id | string Output only. ID of the Docker image. |
name | string Name of the Docker image. The name is unique within the registry. |
digest | string Content-addressable identifier of the Docker image. |
compressed_size | int64 Compressed size of the Docker image, specified in bytes. |
config | Blob Configuration of the Docker image. |
layers[] | Blob Layers of the Docker image. |
tags[] | string Tags of the Docker image. Each tag is unique within the repository. |
created_at | google.protobuf.Timestamp Output only. Creation timestamp in RFC3339 |
Blob
Field | Description |
---|---|
id | string Output only. ID of the blob. |
digest | string Content-addressable identifier of the blob. |
size | int64 Size of the blob, specified in bytes. |
urls[] | string List of blob urls. |