Skip to content

Commit 984f5ac

Browse files
feat: [artifactregistry] add ExportArtifact API (#6919)
* feat: add ExportArtifact API PiperOrigin-RevId: 839457154 Source-Link: googleapis/googleapis@535d161 Source-Link: googleapis/googleapis-gen@6d55877 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWRldnRvb2xzLWFydGlmYWN0cmVnaXN0cnkvLk93bEJvdC55YW1sIiwiaCI6IjZkNTU4NzcxN2EyNTZkYmY1NzM0MTNmY2Q3NzMxZDBlNWVjNjc5MDMifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent c33709f commit 984f5ac

File tree

13 files changed

+24086
-21902
lines changed

13 files changed

+24086
-21902
lines changed

packages/google-devtools-artifactregistry/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ
7070
| delete rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_rule.js) |
7171
| delete tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_tag.js) |
7272
| delete version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_version.js) |
73+
| export artifact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.export_artifact.js) |
7374
| get attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_attachment.js) |
7475
| get docker image | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_docker_image.js) |
7576
| get file | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_file.js) |
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.devtools.artifactregistry.v1;
18+
19+
import "google/api/field_behavior.proto";
20+
import "google/api/resource.proto";
21+
import "google/devtools/artifactregistry/v1/file.proto";
22+
import "google/devtools/artifactregistry/v1/version.proto";
23+
24+
option csharp_namespace = "Google.Cloud.ArtifactRegistry.V1";
25+
option go_package = "cloud.google.com/go/artifactregistry/apiv1/artifactregistrypb;artifactregistrypb";
26+
option java_multiple_files = true;
27+
option java_outer_classname = "ExportProto";
28+
option java_package = "com.google.devtools.artifactregistry.v1";
29+
option php_namespace = "Google\\Cloud\\ArtifactRegistry\\V1";
30+
option ruby_package = "Google::Cloud::ArtifactRegistry::V1";
31+
32+
// The request for exporting an artifact to a destination.
33+
message ExportArtifactRequest {
34+
// The artifact to be exported.
35+
oneof source_artifact {
36+
// The artifact version to export.
37+
// Format:
38+
// projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/versions/{version}
39+
string source_version = 2 [(google.api.resource_reference) = {
40+
type: "artifactregistry.googleapis.com/Version"
41+
}];
42+
43+
// The artifact tag to export.
44+
// Format:projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}
45+
string source_tag = 4 [(google.api.resource_reference) = {
46+
type: "artifactregistry.googleapis.com/Tag"
47+
}];
48+
}
49+
50+
// The destination to export the artifact to.
51+
oneof destination {
52+
// The Cloud Storage path to export the artifact to. Should start with the
53+
// bucket name, and optionally have a directory path. Examples:
54+
// `dst_bucket`, `dst_bucket/sub_dir`.
55+
// Existing objects with the same path will be overwritten.
56+
string gcs_path = 3;
57+
}
58+
59+
// Required. The repository of the artifact to export.
60+
// Format: projects/{project}/locations/{location}/repositories/{repository}
61+
string repository = 1 [
62+
(google.api.field_behavior) = REQUIRED,
63+
(google.api.resource_reference) = {
64+
type: "artifactregistry.googleapis.com/Repository"
65+
}
66+
];
67+
}
68+
69+
// The response for exporting an artifact to a destination.
70+
message ExportArtifactResponse {
71+
// The exported version. Should be the same as the request version with
72+
// fingerprint resource name.
73+
Version exported_version = 1;
74+
}
75+
76+
// The LRO metadata for exporting an artifact.
77+
message ExportArtifactMetadata {
78+
// The exported artifact file.
79+
message ExportedFile {
80+
// The destination the file was exported to.
81+
oneof destination {
82+
// Cloud Storage Object path of the exported file. Examples:
83+
// `dst_bucket/file1`, `dst_bucket/sub_dir/file1`
84+
string gcs_object_path = 2;
85+
}
86+
87+
// Name of the exported artifact file.
88+
// Format: `projects/p1/locations/us/repositories/repo1/files/file1`
89+
string name = 1 [(google.api.resource_reference) = {
90+
type: "artifactregistry.googleapis.com/File"
91+
}];
92+
93+
// The hashes of the file content.
94+
repeated Hash hashes = 3;
95+
}
96+
97+
// The exported artifact files.
98+
repeated ExportedFile exported_files = 1;
99+
}

packages/google-devtools-artifactregistry/protos/google/devtools/artifactregistry/v1/service.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import "google/api/client.proto";
2121
import "google/devtools/artifactregistry/v1/apt_artifact.proto";
2222
import "google/devtools/artifactregistry/v1/artifact.proto";
2323
import "google/devtools/artifactregistry/v1/attachment.proto";
24+
import "google/devtools/artifactregistry/v1/export.proto";
2425
import "google/devtools/artifactregistry/v1/file.proto";
2526
import "google/devtools/artifactregistry/v1/package.proto";
2627
import "google/devtools/artifactregistry/v1/repository.proto";
@@ -541,6 +542,19 @@ service ArtifactRegistry {
541542
metadata_type: "google.devtools.artifactregistry.v1.OperationMetadata"
542543
};
543544
}
545+
546+
// Exports an artifact.
547+
rpc ExportArtifact(ExportArtifactRequest)
548+
returns (google.longrunning.Operation) {
549+
option (google.api.http) = {
550+
post: "/v1/{repository=projects/*/locations/*/repositories/*}:exportArtifact"
551+
body: "*"
552+
};
553+
option (google.longrunning.operation_info) = {
554+
response_type: "google.devtools.artifactregistry.v1.ExportArtifactResponse"
555+
metadata_type: "google.devtools.artifactregistry.v1.ExportArtifactMetadata"
556+
};
557+
}
544558
}
545559

546560
// Metadata type for longrunning-operations, currently empty.

0 commit comments

Comments
 (0)