Skip to content

Commit

Permalink
feat: add format-specific resources MavenArtifact, NpmPackage, `K…
Browse files Browse the repository at this point in the history
…fpArtifact` and `PythonPackage`

feat: add `order_by` to `ListDockerImages`
feat: add an API to get and update VPCSC config
feat: add `BatchDeleteVersionMetadata` to return version that failed to delete
fix!: make `GetFileRequest.name` and `ListFilesRequest.parent` required
fix: make `Package` a resource
fix: deprecate `REDIRECTION_FROM_GCR_IO_FINALIZED`

PiperOrigin-RevId: 506935629
  • Loading branch information
Google APIs authored and Copybara-Service committed Feb 3, 2023
1 parent 2609511 commit c807b74
Show file tree
Hide file tree
Showing 12 changed files with 534 additions and 40 deletions.
1 change: 1 addition & 0 deletions google/devtools/artifactregistry/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ proto_library(
"settings.proto",
"tag.proto",
"version.proto",
"vpcsc_config.proto",
"yum_artifact.proto",
],
deps = [
Expand Down
4 changes: 1 addition & 3 deletions google/devtools/artifactregistry/v1/apt_artifact.proto
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,4 @@ message ImportAptArtifactsResponse {
}

// The operation metadata for importing artifacts.
message ImportAptArtifactsMetadata {

}
message ImportAptArtifactsMetadata {}
245 changes: 242 additions & 3 deletions google/devtools/artifactregistry/v1/artifact.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ message DockerImage {
pattern: "projects/{project}/locations/{location}/repositories/{repository}/dockerImages/{docker_image}"
};

// Required. registry_location, project_id, repository_name and image id forms a unique
// image
// Required. registry_location, project_id, repository_name and image id forms
// a unique image
// name:`projects/<project_id>/locations/<location>/repository/<repository_name>/dockerImages/<docker_image>`.
// For example,
// "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
Expand Down Expand Up @@ -80,18 +80,26 @@ message DockerImage {
// The build time is returned to the client as an RFC 3339 string, which can
// be easily used with the JavaScript Date constructor.
google.protobuf.Timestamp build_time = 7;

// Output only. The time when the docker image was last updated.
google.protobuf.Timestamp update_time = 8
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// The request to list docker images.
message ListDockerImagesRequest {
// Required. The name of the parent resource whose docker images will be listed.
// Required. The name of the parent resource whose docker images will be
// listed.
string parent = 1 [(google.api.field_behavior) = REQUIRED];

// The maximum number of artifacts to return.
int32 page_size = 2;

// The next_page_token value returned from a previous list request, if any.
string page_token = 3;

// The field to order the results by.
string order_by = 4;
}

// The response from listing docker images.
Expand All @@ -114,3 +122,234 @@ message GetDockerImageRequest {
}
];
}

// MavenArtifact represents a maven artifact.
message MavenArtifact {
option (google.api.resource) = {
type: "artifactregistry.googleapis.com/MavenArtifact"
pattern: "projects/{project}/locations/{location}/repositories/{repository}/mavenArtifacts/{maven_artifact}"
};

// Required. registry_location, project_id, repository_name and maven_artifact
// forms a unique artifact For example,
// "projects/test-project/locations/us-west4/repositories/test-repo/mavenArtifacts/
// com.google.guava:guava:31.0-jre",
// where "us-west4" is the registry_location, "test-project" is the
// project_id, "test-repo" is the repository_name and
// "com.google.guava:guava:31.0-jre"
// is the maven artifact.
string name = 1 [(google.api.field_behavior) = REQUIRED];

// Required. URL to access the pom file of the artifact.
// Example:
// us-west4-maven.pkg.dev/test-project/test-repo/com/google/guava/guava/31.0/guava-31.0.pom
string pom_uri = 2 [(google.api.field_behavior) = REQUIRED];

// Group ID for the artifact.
// Example:
// com.google.guava
string group_id = 3;

// Artifact ID for the artifact.
string artifact_id = 4;

// Version of this artifact.
string version = 5;

// Output only. Time the artifact was created.
google.protobuf.Timestamp create_time = 6
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Time the artifact was updated.
google.protobuf.Timestamp update_time = 7
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// The request to list maven artifacts.
message ListMavenArtifactsRequest {
// Required. The name of the parent resource whose maven artifacts will be
// listed.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "artifactregistry.googleapis.com/MavenArtifact"
}
];

// The maximum number of artifacts to return.
int32 page_size = 2;

// The next_page_token value returned from a previous list request, if any.
string page_token = 3;
}

// The response from listing maven artifacts.
message ListMavenArtifactsResponse {
// The maven artifacts returned.
repeated MavenArtifact maven_artifacts = 1;

// The token to retrieve the next page of artifacts, or empty if there are no
// more artifacts to return.
string next_page_token = 2;
}

// The request to get maven artifacts.
message GetMavenArtifactRequest {
// Required. The name of the maven artifact.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "artifactregistry.googleapis.com/MavenArtifact"
}
];
}

// NpmPackage represents an npm artifact.
message NpmPackage {
option (google.api.resource) = {
type: "artifactregistry.googleapis.com/NpmPackage"
pattern: "projects/{project}/locations/{location}/repositories/{repository}/npmPackages/{npm_package}"
};

// Required. registry_location, project_id, repository_name and npm_package
// forms a unique package For example,
// "projects/test-project/locations/us-west4/repositories/test-repo/npmPackages/
// npm_test:1.0.0",
// where "us-west4" is the registry_location, "test-project" is the
// project_id, "test-repo" is the repository_name and
// npm_test:1.0.0" is the npm package.
string name = 1 [(google.api.field_behavior) = REQUIRED];

// Package for the artifact.
string package_name = 3;

// Version of this package.
string version = 4;

// Tags attached to this package.
repeated string tags = 5;

// Output only. Time the package was created.
google.protobuf.Timestamp create_time = 6
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Time the package was updated.
google.protobuf.Timestamp update_time = 7
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// The request to list npm packages.
message ListNpmPackagesRequest {
// Required. The name of the parent resource whose npm packages will be
// listed.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "artifactregistry.googleapis.com/NpmPackage"
}
];

// The maximum number of artifacts to return.
int32 page_size = 2;

// The next_page_token value returned from a previous list request, if any.
string page_token = 3;
}

// The response from listing npm packages.
message ListNpmPackagesResponse {
// The npm packages returned.
repeated NpmPackage npm_packages = 1;

// The token to retrieve the next page of artifacts, or empty if there are no
// more artifacts to return.
string next_page_token = 2;
}

// The request to get npm packages.
message GetNpmPackageRequest {
// Required. The name of the npm package.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "artifactregistry.googleapis.com/NpmPackage"
}
];
}

// PythonPackage represents a python artifact.
message PythonPackage {
option (google.api.resource) = {
type: "artifactregistry.googleapis.com/PythonPackage"
pattern: "projects/{project}/locations/{location}/repositories/{repository}/pythonPackages/{python_package}"
};

// Required. registry_location, project_id, repository_name and python_package
// forms a unique package
// name:`projects/<project_id>/locations/<location>/repository/<repository_name>/pythonPackages/<python_package>`.
// For example,
// "projects/test-project/locations/us-west4/repositories/test-repo/pythonPackages/
// python_package:1.0.0",
// where "us-west4" is the registry_location, "test-project" is the
// project_id, "test-repo" is the repository_name and
// python_package:1.0.0" is the python package.
string name = 1 [(google.api.field_behavior) = REQUIRED];

// Required. URL to access the package.
// Example:
// us-west4-python.pkg.dev/test-project/test-repo/python_package/file-name-1.0.0.tar.gz
string uri = 2 [(google.api.field_behavior) = REQUIRED];

// Package for the artifact.
string package_name = 3;

// Version of this package.
string version = 4;

// Output only. Time the package was created.
google.protobuf.Timestamp create_time = 6
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Time the package was updated.
google.protobuf.Timestamp update_time = 7
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// The request to list python packages.
message ListPythonPackagesRequest {
// Required. The name of the parent resource whose python packages will be
// listed.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "artifactregistry.googleapis.com/PythonPackage"
}
];

// The maximum number of artifacts to return.
int32 page_size = 2;

// The next_page_token value returned from a previous list request, if any.
string page_token = 3;
}

// The response from listing python packages.
message ListPythonPackagesResponse {
// The python packages returned.
repeated PythonPackage python_packages = 1;

// The token to retrieve the next page of artifacts, or empty if there are no
// more artifacts to return.
string next_page_token = 2;
}

// The request to get python packages.
message GetPythonPackageRequest {
// Required. The name of the python package.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "artifactregistry.googleapis.com/PythonPackage"
}
];
}
9 changes: 8 additions & 1 deletion google/devtools/artifactregistry/v1/artifactregistry_v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ name: artifactregistry.googleapis.com
title: Artifact Registry API

apis:
- name: google.devtools.artifactregistry.v1.ArtifactRegistry
- name: google.cloud.location.Locations
- name: google.devtools.artifactregistry.v1.ArtifactRegistry
- name: google.longrunning.Operations

types:
- name: google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata
- name: google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata
- name: google.devtools.artifactregistry.v1.ImportAptArtifactsResponse
- name: google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata
- name: google.devtools.artifactregistry.v1.ImportYumArtifactsResponse
- name: google.devtools.artifactregistry.v1.KfpArtifact
- name: google.devtools.artifactregistry.v1.OperationMetadata

documentation:
Expand Down Expand Up @@ -111,6 +114,10 @@ authentication:
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.devtools.artifactregistry.v1.ArtifactRegistry.UpdateVPCSCConfig
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.longrunning.Operations.GetOperation
oauth:
canonical_scopes: |-
Expand Down
36 changes: 27 additions & 9 deletions google/devtools/artifactregistry/v1/file.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ syntax = "proto3";

package google.devtools.artifactregistry.v1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";

Expand Down Expand Up @@ -66,21 +67,33 @@ message File {
// The hashes of the file content.
repeated Hash hashes = 4;

// The time when the File was created.
google.protobuf.Timestamp create_time = 5;
// Output only. The time when the File was created.
google.protobuf.Timestamp create_time = 5
[(google.api.field_behavior) = OUTPUT_ONLY];

// The time when the File was last updated.
google.protobuf.Timestamp update_time = 6;
// Output only. The time when the File was last updated.
google.protobuf.Timestamp update_time = 6
[(google.api.field_behavior) = OUTPUT_ONLY];

// The name of the Package or Version that owns this file, if any.
string owner = 7;

// Output only. The time when the last attempt to refresh the file's data was
// made. Only set when the repository is remote.
google.protobuf.Timestamp fetch_time = 8
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// The request to list files.
message ListFilesRequest {
// The name of the repository whose files will be listed. For example:
// "projects/p1/locations/us-central1/repositories/repo1
string parent = 1;
// Required. The name of the repository whose files will be listed. For
// example: "projects/p1/locations/us-central1/repositories/repo1
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "artifactregistry.googleapis.com/File"
}
];

// An expression for filtering the results of the request. Filter rules are
// case insensitive. The fields eligible for filtering are:
Expand Down Expand Up @@ -118,6 +131,11 @@ message ListFilesResponse {

// The request to retrieve a file.
message GetFileRequest {
// The name of the file to retrieve.
string name = 1;
// Required. The name of the file to retrieve.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "artifactregistry.googleapis.com/File"
}
];
}

0 comments on commit c807b74

Please sign in to comment.