- 1.50.0 (latest)
- 1.48.0
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.0
- 1.43.0
- 1.42.0
- 1.41.0
- 1.40.0
- 1.39.0
- 1.38.0
- 1.36.0
- 1.35.0
- 1.34.0
- 1.33.0
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.0
- 1.28.0
- 1.27.0
- 1.26.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.0
- 1.11.0
- 1.10.0
- 1.9.0
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.9
- 1.1.1
- 0.5.0
- 0.4.0
public class ArtifactRegistryClient implements BackgroundResource
Service Description: The Artifact Registry API service.
Artifact Registry is an artifact management system for storing artifacts from different package management systems.
The resources managed by this API are:
- Repositories, which group packages and their data.
- Packages, which group versions and their tags.
- Versions, which are specific forms of a package.
- Tags, which represent alternative names for versions.
- Files, which contain content and are optionally associated with a Package or Version.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DockerImageName name =
DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]");
DockerImage response = artifactRegistryClient.getDockerImage(name);
}
Note: close() needs to be called on the ArtifactRegistryClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of ArtifactRegistrySettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ArtifactRegistrySettings artifactRegistrySettings =
ArtifactRegistrySettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ArtifactRegistryClient artifactRegistryClient =
ArtifactRegistryClient.create(artifactRegistrySettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ArtifactRegistrySettings artifactRegistrySettings =
ArtifactRegistrySettings.newBuilder().setEndpoint(myEndpoint).build();
ArtifactRegistryClient artifactRegistryClient =
ArtifactRegistryClient.create(artifactRegistrySettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ArtifactRegistrySettings artifactRegistrySettings =
ArtifactRegistrySettings.newHttpJsonBuilder().build();
ArtifactRegistryClient artifactRegistryClient =
ArtifactRegistryClient.create(artifactRegistrySettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final ArtifactRegistryClient create()
Constructs an instance of ArtifactRegistryClient with default settings.
Returns | |
---|---|
Type | Description |
ArtifactRegistryClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(ArtifactRegistrySettings settings)
public static final ArtifactRegistryClient create(ArtifactRegistrySettings settings)
Constructs an instance of ArtifactRegistryClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Parameter | |
---|---|
Name | Description |
settings | ArtifactRegistrySettings |
Returns | |
---|---|
Type | Description |
ArtifactRegistryClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(ArtifactRegistryStub stub)
public static final ArtifactRegistryClient create(ArtifactRegistryStub stub)
Constructs an instance of ArtifactRegistryClient, using the given stub for making calls. This is for advanced usage - prefer using create(ArtifactRegistrySettings).
Parameter | |
---|---|
Name | Description |
stub | ArtifactRegistryStub |
Returns | |
---|---|
Type | Description |
ArtifactRegistryClient |
Constructors
ArtifactRegistryClient(ArtifactRegistrySettings settings)
protected ArtifactRegistryClient(ArtifactRegistrySettings settings)
Constructs an instance of ArtifactRegistryClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Parameter | |
---|---|
Name | Description |
settings | ArtifactRegistrySettings |
ArtifactRegistryClient(ArtifactRegistryStub stub)
protected ArtifactRegistryClient(ArtifactRegistryStub stub)
Parameter | |
---|---|
Name | Description |
stub | ArtifactRegistryStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration | long |
unit | TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
InterruptedException |
close()
public final void close()
createRepositoryAsync(CreateRepositoryRequest request)
public final OperationFuture<Repository,OperationMetadata> createRepositoryAsync(CreateRepositoryRequest request)
Creates a repository. The returned Operation will finish once the repository has been created. Its response will be the created Repository.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
CreateRepositoryRequest request =
CreateRepositoryRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setRepositoryId("repositoryId2113747461")
.setRepository(Repository.newBuilder().build())
.build();
Repository response = artifactRegistryClient.createRepositoryAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request | CreateRepositoryRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Repository,OperationMetadata> |
createRepositoryAsync(LocationName parent, Repository repository, String repositoryId)
public final OperationFuture<Repository,OperationMetadata> createRepositoryAsync(LocationName parent, Repository repository, String repositoryId)
Creates a repository. The returned Operation will finish once the repository has been created. Its response will be the created Repository.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Repository repository = Repository.newBuilder().build();
String repositoryId = "repositoryId2113747461";
Repository response =
artifactRegistryClient.createRepositoryAsync(parent, repository, repositoryId).get();
}
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The name of the parent resource where the repository will be created. |
repository | Repository The repository to be created. |
repositoryId | String The repository id to use for this repository. |
Returns | |
---|---|
Type | Description |
OperationFuture<Repository,OperationMetadata> |
createRepositoryAsync(String parent, Repository repository, String repositoryId)
public final OperationFuture<Repository,OperationMetadata> createRepositoryAsync(String parent, Repository repository, String repositoryId)
Creates a repository. The returned Operation will finish once the repository has been created. Its response will be the created Repository.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Repository repository = Repository.newBuilder().build();
String repositoryId = "repositoryId2113747461";
Repository response =
artifactRegistryClient.createRepositoryAsync(parent, repository, repositoryId).get();
}
Parameters | |
---|---|
Name | Description |
parent | String Required. The name of the parent resource where the repository will be created. |
repository | Repository The repository to be created. |
repositoryId | String The repository id to use for this repository. |
Returns | |
---|---|
Type | Description |
OperationFuture<Repository,OperationMetadata> |
createRepositoryCallable()
public final UnaryCallable<CreateRepositoryRequest,Operation> createRepositoryCallable()
Creates a repository. The returned Operation will finish once the repository has been created. Its response will be the created Repository.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
CreateRepositoryRequest request =
CreateRepositoryRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setRepositoryId("repositoryId2113747461")
.setRepository(Repository.newBuilder().build())
.build();
ApiFuture<Operation> future =
artifactRegistryClient.createRepositoryCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateRepositoryRequest,Operation> |
createRepositoryOperationCallable()
public final OperationCallable<CreateRepositoryRequest,Repository,OperationMetadata> createRepositoryOperationCallable()
Creates a repository. The returned Operation will finish once the repository has been created. Its response will be the created Repository.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
CreateRepositoryRequest request =
CreateRepositoryRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setRepositoryId("repositoryId2113747461")
.setRepository(Repository.newBuilder().build())
.build();
OperationFuture<Repository, OperationMetadata> future =
artifactRegistryClient.createRepositoryOperationCallable().futureCall(request);
// Do something.
Repository response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<CreateRepositoryRequest,Repository,OperationMetadata> |
createTag(CreateTagRequest request)
public final Tag createTag(CreateTagRequest request)
Creates a tag.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
CreateTagRequest request =
CreateTagRequest.newBuilder()
.setParent("parent-995424086")
.setTagId("tagId110119509")
.setTag(Tag.newBuilder().build())
.build();
Tag response = artifactRegistryClient.createTag(request);
}
Parameter | |
---|---|
Name | Description |
request | CreateTagRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Tag |
createTag(String parent, Tag tag, String tagId)
public final Tag createTag(String parent, Tag tag, String tagId)
Creates a tag.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String parent = "parent-995424086";
Tag tag = Tag.newBuilder().build();
String tagId = "tagId110119509";
Tag response = artifactRegistryClient.createTag(parent, tag, tagId);
}
Parameters | |
---|---|
Name | Description |
parent | String The name of the parent resource where the tag will be created. |
tag | Tag The tag to be created. |
tagId | String The tag id to use for this repository. |
Returns | |
---|---|
Type | Description |
Tag |
createTagCallable()
public final UnaryCallable<CreateTagRequest,Tag> createTagCallable()
Creates a tag.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
CreateTagRequest request =
CreateTagRequest.newBuilder()
.setParent("parent-995424086")
.setTagId("tagId110119509")
.setTag(Tag.newBuilder().build())
.build();
ApiFuture<Tag> future = artifactRegistryClient.createTagCallable().futureCall(request);
// Do something.
Tag response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateTagRequest,Tag> |
deletePackageAsync(DeletePackageRequest request)
public final OperationFuture<Empty,OperationMetadata> deletePackageAsync(DeletePackageRequest request)
Deletes a package and all of its versions and tags. The returned operation will complete once the package has been deleted.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DeletePackageRequest request =
DeletePackageRequest.newBuilder()
.setName(
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString())
.build();
artifactRegistryClient.deletePackageAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request | DeletePackageRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,OperationMetadata> |
deletePackageAsync(PackageName name)
public final OperationFuture<Empty,OperationMetadata> deletePackageAsync(PackageName name)
Deletes a package and all of its versions and tags. The returned operation will complete once the package has been deleted.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
PackageName name = PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]");
artifactRegistryClient.deletePackageAsync(name).get();
}
Parameter | |
---|---|
Name | Description |
name | PackageName Required. The name of the package to delete. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,OperationMetadata> |
deletePackageAsync(String name)
public final OperationFuture<Empty,OperationMetadata> deletePackageAsync(String name)
Deletes a package and all of its versions and tags. The returned operation will complete once the package has been deleted.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name =
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString();
artifactRegistryClient.deletePackageAsync(name).get();
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the package to delete. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,OperationMetadata> |
deletePackageCallable()
public final UnaryCallable<DeletePackageRequest,Operation> deletePackageCallable()
Deletes a package and all of its versions and tags. The returned operation will complete once the package has been deleted.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DeletePackageRequest request =
DeletePackageRequest.newBuilder()
.setName(
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString())
.build();
ApiFuture<Operation> future =
artifactRegistryClient.deletePackageCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeletePackageRequest,Operation> |
deletePackageOperationCallable()
public final OperationCallable<DeletePackageRequest,Empty,OperationMetadata> deletePackageOperationCallable()
Deletes a package and all of its versions and tags. The returned operation will complete once the package has been deleted.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DeletePackageRequest request =
DeletePackageRequest.newBuilder()
.setName(
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
artifactRegistryClient.deletePackageOperationCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeletePackageRequest,Empty,OperationMetadata> |
deleteRepositoryAsync(DeleteRepositoryRequest request)
public final OperationFuture<Empty,OperationMetadata> deleteRepositoryAsync(DeleteRepositoryRequest request)
Deletes a repository and all of its contents. The returned Operation will finish once the repository has been deleted. It will not have any Operation metadata and will return a google.protobuf.Empty response.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DeleteRepositoryRequest request =
DeleteRepositoryRequest.newBuilder()
.setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.build();
artifactRegistryClient.deleteRepositoryAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request | DeleteRepositoryRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,OperationMetadata> |
deleteRepositoryAsync(RepositoryName name)
public final OperationFuture<Empty,OperationMetadata> deleteRepositoryAsync(RepositoryName name)
Deletes a repository and all of its contents. The returned Operation will finish once the repository has been deleted. It will not have any Operation metadata and will return a google.protobuf.Empty response.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
RepositoryName name = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]");
artifactRegistryClient.deleteRepositoryAsync(name).get();
}
Parameter | |
---|---|
Name | Description |
name | RepositoryName Required. The name of the repository to delete. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,OperationMetadata> |
deleteRepositoryAsync(String name)
public final OperationFuture<Empty,OperationMetadata> deleteRepositoryAsync(String name)
Deletes a repository and all of its contents. The returned Operation will finish once the repository has been deleted. It will not have any Operation metadata and will return a google.protobuf.Empty response.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString();
artifactRegistryClient.deleteRepositoryAsync(name).get();
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the repository to delete. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,OperationMetadata> |
deleteRepositoryCallable()
public final UnaryCallable<DeleteRepositoryRequest,Operation> deleteRepositoryCallable()
Deletes a repository and all of its contents. The returned Operation will finish once the repository has been deleted. It will not have any Operation metadata and will return a google.protobuf.Empty response.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DeleteRepositoryRequest request =
DeleteRepositoryRequest.newBuilder()
.setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.build();
ApiFuture<Operation> future =
artifactRegistryClient.deleteRepositoryCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteRepositoryRequest,Operation> |
deleteRepositoryOperationCallable()
public final OperationCallable<DeleteRepositoryRequest,Empty,OperationMetadata> deleteRepositoryOperationCallable()
Deletes a repository and all of its contents. The returned Operation will finish once the repository has been deleted. It will not have any Operation metadata and will return a google.protobuf.Empty response.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DeleteRepositoryRequest request =
DeleteRepositoryRequest.newBuilder()
.setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
artifactRegistryClient.deleteRepositoryOperationCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeleteRepositoryRequest,Empty,OperationMetadata> |
deleteTag(DeleteTagRequest request)
public final void deleteTag(DeleteTagRequest request)
Deletes a tag.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DeleteTagRequest request = DeleteTagRequest.newBuilder().setName("name3373707").build();
artifactRegistryClient.deleteTag(request);
}
Parameter | |
---|---|
Name | Description |
request | DeleteTagRequest The request object containing all of the parameters for the API call. |
deleteTag(String name)
public final void deleteTag(String name)
Deletes a tag.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name = "name3373707";
artifactRegistryClient.deleteTag(name);
}
Parameter | |
---|---|
Name | Description |
name | String The name of the tag to delete. |
deleteTagCallable()
public final UnaryCallable<DeleteTagRequest,Empty> deleteTagCallable()
Deletes a tag.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DeleteTagRequest request = DeleteTagRequest.newBuilder().setName("name3373707").build();
ApiFuture<Empty> future = artifactRegistryClient.deleteTagCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteTagRequest,Empty> |
deleteVersionAsync(DeleteVersionRequest request)
public final OperationFuture<Empty,OperationMetadata> deleteVersionAsync(DeleteVersionRequest request)
Deletes a version and all of its content. The returned operation will complete once the version has been deleted.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DeleteVersionRequest request =
DeleteVersionRequest.newBuilder().setName("name3373707").setForce(true).build();
artifactRegistryClient.deleteVersionAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request | DeleteVersionRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,OperationMetadata> |
deleteVersionAsync(String name)
public final OperationFuture<Empty,OperationMetadata> deleteVersionAsync(String name)
Deletes a version and all of its content. The returned operation will complete once the version has been deleted.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name = "name3373707";
artifactRegistryClient.deleteVersionAsync(name).get();
}
Parameter | |
---|---|
Name | Description |
name | String The name of the version to delete. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,OperationMetadata> |
deleteVersionCallable()
public final UnaryCallable<DeleteVersionRequest,Operation> deleteVersionCallable()
Deletes a version and all of its content. The returned operation will complete once the version has been deleted.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DeleteVersionRequest request =
DeleteVersionRequest.newBuilder().setName("name3373707").setForce(true).build();
ApiFuture<Operation> future =
artifactRegistryClient.deleteVersionCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteVersionRequest,Operation> |
deleteVersionOperationCallable()
public final OperationCallable<DeleteVersionRequest,Empty,OperationMetadata> deleteVersionOperationCallable()
Deletes a version and all of its content. The returned operation will complete once the version has been deleted.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DeleteVersionRequest request =
DeleteVersionRequest.newBuilder().setName("name3373707").setForce(true).build();
OperationFuture<Empty, OperationMetadata> future =
artifactRegistryClient.deleteVersionOperationCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeleteVersionRequest,Empty,OperationMetadata> |
getDockerImage(DockerImageName name)
public final DockerImage getDockerImage(DockerImageName name)
Gets a docker image.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DockerImageName name =
DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]");
DockerImage response = artifactRegistryClient.getDockerImage(name);
}
Parameter | |
---|---|
Name | Description |
name | DockerImageName Required. The name of the docker images. |
Returns | |
---|---|
Type | Description |
DockerImage |
getDockerImage(GetDockerImageRequest request)
public final DockerImage getDockerImage(GetDockerImageRequest request)
Gets a docker image.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetDockerImageRequest request =
GetDockerImageRequest.newBuilder()
.setName(
DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
.toString())
.build();
DockerImage response = artifactRegistryClient.getDockerImage(request);
}
Parameter | |
---|---|
Name | Description |
request | GetDockerImageRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
DockerImage |
getDockerImage(String name)
public final DockerImage getDockerImage(String name)
Gets a docker image.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name =
DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
.toString();
DockerImage response = artifactRegistryClient.getDockerImage(name);
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the docker images. |
Returns | |
---|---|
Type | Description |
DockerImage |
getDockerImageCallable()
public final UnaryCallable<GetDockerImageRequest,DockerImage> getDockerImageCallable()
Gets a docker image.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetDockerImageRequest request =
GetDockerImageRequest.newBuilder()
.setName(
DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
.toString())
.build();
ApiFuture<DockerImage> future =
artifactRegistryClient.getDockerImageCallable().futureCall(request);
// Do something.
DockerImage response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetDockerImageRequest,DockerImage> |
getFile(FileName name)
public final File getFile(FileName name)
Gets a file.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
FileName name = FileName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[FILE]");
File response = artifactRegistryClient.getFile(name);
}
Parameter | |
---|---|
Name | Description |
name | FileName Required. The name of the file to retrieve. |
Returns | |
---|---|
Type | Description |
File |
getFile(GetFileRequest request)
public final File getFile(GetFileRequest request)
Gets a file.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetFileRequest request =
GetFileRequest.newBuilder()
.setName(FileName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[FILE]").toString())
.build();
File response = artifactRegistryClient.getFile(request);
}
Parameter | |
---|---|
Name | Description |
request | GetFileRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
File |
getFile(String name)
public final File getFile(String name)
Gets a file.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name = FileName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[FILE]").toString();
File response = artifactRegistryClient.getFile(name);
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the file to retrieve. |
Returns | |
---|---|
Type | Description |
File |
getFileCallable()
public final UnaryCallable<GetFileRequest,File> getFileCallable()
Gets a file.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetFileRequest request =
GetFileRequest.newBuilder()
.setName(FileName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[FILE]").toString())
.build();
ApiFuture<File> future = artifactRegistryClient.getFileCallable().futureCall(request);
// Do something.
File response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetFileRequest,File> |
getHttpJsonOperationsClient()
public final OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Returns | |
---|---|
Type | Description |
OperationsClient |
getIamPolicy(GetIamPolicyRequest request)
public final Policy getIamPolicy(GetIamPolicyRequest request)
Gets the IAM policy for a given resource.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = artifactRegistryClient.getIamPolicy(request);
}
Parameter | |
---|---|
Name | Description |
request | com.google.iam.v1.GetIamPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
com.google.iam.v1.Policy |
getIamPolicyCallable()
public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()
Gets the IAM policy for a given resource.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future = artifactRegistryClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getLocation(GetLocationRequest request)
public final Location getLocation(GetLocationRequest request)
Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = artifactRegistryClient.getLocation(request);
}
Parameter | |
---|---|
Name | Description |
request | com.google.cloud.location.GetLocationRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
com.google.cloud.location.Location |
getLocationCallable()
public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = artifactRegistryClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getMavenArtifact(GetMavenArtifactRequest request)
public final MavenArtifact getMavenArtifact(GetMavenArtifactRequest request)
Gets a maven artifact.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetMavenArtifactRequest request =
GetMavenArtifactRequest.newBuilder()
.setName(
MavenArtifactName.of(
"[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[MAVEN_ARTIFACT]")
.toString())
.build();
MavenArtifact response = artifactRegistryClient.getMavenArtifact(request);
}
Parameter | |
---|---|
Name | Description |
request | GetMavenArtifactRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
MavenArtifact |
getMavenArtifact(MavenArtifactName name)
public final MavenArtifact getMavenArtifact(MavenArtifactName name)
Gets a maven artifact.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
MavenArtifactName name =
MavenArtifactName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[MAVEN_ARTIFACT]");
MavenArtifact response = artifactRegistryClient.getMavenArtifact(name);
}
Parameter | |
---|---|
Name | Description |
name | MavenArtifactName Required. The name of the maven artifact. |
Returns | |
---|---|
Type | Description |
MavenArtifact |
getMavenArtifact(String name)
public final MavenArtifact getMavenArtifact(String name)
Gets a maven artifact.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name =
MavenArtifactName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[MAVEN_ARTIFACT]")
.toString();
MavenArtifact response = artifactRegistryClient.getMavenArtifact(name);
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the maven artifact. |
Returns | |
---|---|
Type | Description |
MavenArtifact |
getMavenArtifactCallable()
public final UnaryCallable<GetMavenArtifactRequest,MavenArtifact> getMavenArtifactCallable()
Gets a maven artifact.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetMavenArtifactRequest request =
GetMavenArtifactRequest.newBuilder()
.setName(
MavenArtifactName.of(
"[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[MAVEN_ARTIFACT]")
.toString())
.build();
ApiFuture<MavenArtifact> future =
artifactRegistryClient.getMavenArtifactCallable().futureCall(request);
// Do something.
MavenArtifact response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetMavenArtifactRequest,MavenArtifact> |
getNpmPackage(GetNpmPackageRequest request)
public final NpmPackage getNpmPackage(GetNpmPackageRequest request)
Gets a npm package.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetNpmPackageRequest request =
GetNpmPackageRequest.newBuilder()
.setName(
NpmPackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[NPM_PACKAGE]")
.toString())
.build();
NpmPackage response = artifactRegistryClient.getNpmPackage(request);
}
Parameter | |
---|---|
Name | Description |
request | GetNpmPackageRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
NpmPackage |
getNpmPackage(NpmPackageName name)
public final NpmPackage getNpmPackage(NpmPackageName name)
Gets a npm package.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
NpmPackageName name =
NpmPackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[NPM_PACKAGE]");
NpmPackage response = artifactRegistryClient.getNpmPackage(name);
}
Parameter | |
---|---|
Name | Description |
name | NpmPackageName Required. The name of the npm package. |
Returns | |
---|---|
Type | Description |
NpmPackage |
getNpmPackage(String name)
public final NpmPackage getNpmPackage(String name)
Gets a npm package.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name =
NpmPackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[NPM_PACKAGE]").toString();
NpmPackage response = artifactRegistryClient.getNpmPackage(name);
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the npm package. |
Returns | |
---|---|
Type | Description |
NpmPackage |
getNpmPackageCallable()
public final UnaryCallable<GetNpmPackageRequest,NpmPackage> getNpmPackageCallable()
Gets a npm package.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetNpmPackageRequest request =
GetNpmPackageRequest.newBuilder()
.setName(
NpmPackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[NPM_PACKAGE]")
.toString())
.build();
ApiFuture<NpmPackage> future =
artifactRegistryClient.getNpmPackageCallable().futureCall(request);
// Do something.
NpmPackage response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetNpmPackageRequest,NpmPackage> |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Returns | |
---|---|
Type | Description |
OperationsClient |
getPackage(GetPackageRequest request)
public final Package getPackage(GetPackageRequest request)
Gets a package.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetPackageRequest request =
GetPackageRequest.newBuilder()
.setName(
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString())
.build();
Package response = artifactRegistryClient.getPackage(request);
}
Parameter | |
---|---|
Name | Description |
request | GetPackageRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Package |
getPackage(PackageName name)
public final Package getPackage(PackageName name)
Gets a package.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
PackageName name = PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]");
Package response = artifactRegistryClient.getPackage(name);
}
Parameter | |
---|---|
Name | Description |
name | PackageName Required. The name of the package to retrieve. |
Returns | |
---|---|
Type | Description |
Package |
getPackage(String name)
public final Package getPackage(String name)
Gets a package.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name =
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString();
Package response = artifactRegistryClient.getPackage(name);
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the package to retrieve. |
Returns | |
---|---|
Type | Description |
Package |
getPackageCallable()
public final UnaryCallable<GetPackageRequest,Package> getPackageCallable()
Gets a package.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetPackageRequest request =
GetPackageRequest.newBuilder()
.setName(
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString())
.build();
ApiFuture<Package> future = artifactRegistryClient.getPackageCallable().futureCall(request);
// Do something.
Package response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetPackageRequest,Package> |
getProjectSettings(GetProjectSettingsRequest request)
public final ProjectSettings getProjectSettings(GetProjectSettingsRequest request)
Retrieves the Settings for the Project.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetProjectSettingsRequest request =
GetProjectSettingsRequest.newBuilder()
.setName(ProjectSettingsName.of("[PROJECT]").toString())
.build();
ProjectSettings response = artifactRegistryClient.getProjectSettings(request);
}
Parameter | |
---|---|
Name | Description |
request | GetProjectSettingsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
ProjectSettings |
getProjectSettings(ProjectSettingsName name)
public final ProjectSettings getProjectSettings(ProjectSettingsName name)
Retrieves the Settings for the Project.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
ProjectSettingsName name = ProjectSettingsName.of("[PROJECT]");
ProjectSettings response = artifactRegistryClient.getProjectSettings(name);
}
Parameter | |
---|---|
Name | Description |
name | ProjectSettingsName Required. The name of the projectSettings resource. |
Returns | |
---|---|
Type | Description |
ProjectSettings |
getProjectSettings(String name)
public final ProjectSettings getProjectSettings(String name)
Retrieves the Settings for the Project.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name = ProjectSettingsName.of("[PROJECT]").toString();
ProjectSettings response = artifactRegistryClient.getProjectSettings(name);
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the projectSettings resource. |
Returns | |
---|---|
Type | Description |
ProjectSettings |
getProjectSettingsCallable()
public final UnaryCallable<GetProjectSettingsRequest,ProjectSettings> getProjectSettingsCallable()
Retrieves the Settings for the Project.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetProjectSettingsRequest request =
GetProjectSettingsRequest.newBuilder()
.setName(ProjectSettingsName.of("[PROJECT]").toString())
.build();
ApiFuture<ProjectSettings> future =
artifactRegistryClient.getProjectSettingsCallable().futureCall(request);
// Do something.
ProjectSettings response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetProjectSettingsRequest,ProjectSettings> |
getPythonPackage(GetPythonPackageRequest request)
public final PythonPackage getPythonPackage(GetPythonPackageRequest request)
Gets a python package.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetPythonPackageRequest request =
GetPythonPackageRequest.newBuilder()
.setName(
PythonPackageName.of(
"[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PYTHON_PACKAGE]")
.toString())
.build();
PythonPackage response = artifactRegistryClient.getPythonPackage(request);
}
Parameter | |
---|---|
Name | Description |
request | GetPythonPackageRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
PythonPackage |
getPythonPackage(PythonPackageName name)
public final PythonPackage getPythonPackage(PythonPackageName name)
Gets a python package.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
PythonPackageName name =
PythonPackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PYTHON_PACKAGE]");
PythonPackage response = artifactRegistryClient.getPythonPackage(name);
}
Parameter | |
---|---|
Name | Description |
name | PythonPackageName Required. The name of the python package. |
Returns | |
---|---|
Type | Description |
PythonPackage |
getPythonPackage(String name)
public final PythonPackage getPythonPackage(String name)
Gets a python package.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name =
PythonPackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PYTHON_PACKAGE]")
.toString();
PythonPackage response = artifactRegistryClient.getPythonPackage(name);
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the python package. |
Returns | |
---|---|
Type | Description |
PythonPackage |
getPythonPackageCallable()
public final UnaryCallable<GetPythonPackageRequest,PythonPackage> getPythonPackageCallable()
Gets a python package.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetPythonPackageRequest request =
GetPythonPackageRequest.newBuilder()
.setName(
PythonPackageName.of(
"[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PYTHON_PACKAGE]")
.toString())
.build();
ApiFuture<PythonPackage> future =
artifactRegistryClient.getPythonPackageCallable().futureCall(request);
// Do something.
PythonPackage response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetPythonPackageRequest,PythonPackage> |
getRepository(GetRepositoryRequest request)
public final Repository getRepository(GetRepositoryRequest request)
Gets a repository.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetRepositoryRequest request =
GetRepositoryRequest.newBuilder()
.setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.build();
Repository response = artifactRegistryClient.getRepository(request);
}
Parameter | |
---|---|
Name | Description |
request | GetRepositoryRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Repository |
getRepository(RepositoryName name)
public final Repository getRepository(RepositoryName name)
Gets a repository.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
RepositoryName name = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]");
Repository response = artifactRegistryClient.getRepository(name);
}
Parameter | |
---|---|
Name | Description |
name | RepositoryName Required. The name of the repository to retrieve. |
Returns | |
---|---|
Type | Description |
Repository |
getRepository(String name)
public final Repository getRepository(String name)
Gets a repository.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString();
Repository response = artifactRegistryClient.getRepository(name);
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the repository to retrieve. |
Returns | |
---|---|
Type | Description |
Repository |
getRepositoryCallable()
public final UnaryCallable<GetRepositoryRequest,Repository> getRepositoryCallable()
Gets a repository.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetRepositoryRequest request =
GetRepositoryRequest.newBuilder()
.setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.build();
ApiFuture<Repository> future =
artifactRegistryClient.getRepositoryCallable().futureCall(request);
// Do something.
Repository response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetRepositoryRequest,Repository> |
getSettings()
public final ArtifactRegistrySettings getSettings()
Returns | |
---|---|
Type | Description |
ArtifactRegistrySettings |
getStub()
public ArtifactRegistryStub getStub()
Returns | |
---|---|
Type | Description |
ArtifactRegistryStub |
getTag(GetTagRequest request)
public final Tag getTag(GetTagRequest request)
Gets a tag.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetTagRequest request = GetTagRequest.newBuilder().setName("name3373707").build();
Tag response = artifactRegistryClient.getTag(request);
}
Parameter | |
---|---|
Name | Description |
request | GetTagRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Tag |
getTag(String name)
public final Tag getTag(String name)
Gets a tag.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name = "name3373707";
Tag response = artifactRegistryClient.getTag(name);
}
Parameter | |
---|---|
Name | Description |
name | String The name of the tag to retrieve. |
Returns | |
---|---|
Type | Description |
Tag |
getTagCallable()
public final UnaryCallable<GetTagRequest,Tag> getTagCallable()
Gets a tag.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetTagRequest request = GetTagRequest.newBuilder().setName("name3373707").build();
ApiFuture<Tag> future = artifactRegistryClient.getTagCallable().futureCall(request);
// Do something.
Tag response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetTagRequest,Tag> |
getVPCSCConfig(GetVPCSCConfigRequest request)
public final VPCSCConfig getVPCSCConfig(GetVPCSCConfigRequest request)
Retrieves the VPCSC Config for the Project.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetVPCSCConfigRequest request =
GetVPCSCConfigRequest.newBuilder()
.setName(VpcscConfigName.of("[PROJECT]", "[LOCATION]").toString())
.build();
VPCSCConfig response = artifactRegistryClient.getVPCSCConfig(request);
}
Parameter | |
---|---|
Name | Description |
request | GetVPCSCConfigRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
VPCSCConfig |
getVPCSCConfig(VpcscConfigName name)
public final VPCSCConfig getVPCSCConfig(VpcscConfigName name)
Retrieves the VPCSC Config for the Project.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
VpcscConfigName name = VpcscConfigName.of("[PROJECT]", "[LOCATION]");
VPCSCConfig response = artifactRegistryClient.getVPCSCConfig(name);
}
Parameter | |
---|---|
Name | Description |
name | VpcscConfigName Required. The name of the VPCSCConfig resource. |
Returns | |
---|---|
Type | Description |
VPCSCConfig |
getVPCSCConfig(String name)
public final VPCSCConfig getVPCSCConfig(String name)
Retrieves the VPCSC Config for the Project.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name = VpcscConfigName.of("[PROJECT]", "[LOCATION]").toString();
VPCSCConfig response = artifactRegistryClient.getVPCSCConfig(name);
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the VPCSCConfig resource. |
Returns | |
---|---|
Type | Description |
VPCSCConfig |
getVPCSCConfigCallable()
public final UnaryCallable<GetVPCSCConfigRequest,VPCSCConfig> getVPCSCConfigCallable()
Retrieves the VPCSC Config for the Project.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetVPCSCConfigRequest request =
GetVPCSCConfigRequest.newBuilder()
.setName(VpcscConfigName.of("[PROJECT]", "[LOCATION]").toString())
.build();
ApiFuture<VPCSCConfig> future =
artifactRegistryClient.getVPCSCConfigCallable().futureCall(request);
// Do something.
VPCSCConfig response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetVPCSCConfigRequest,VPCSCConfig> |
getVersion(GetVersionRequest request)
public final Version getVersion(GetVersionRequest request)
Gets a version
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetVersionRequest request =
GetVersionRequest.newBuilder()
.setName("name3373707")
.setView(VersionView.forNumber(0))
.build();
Version response = artifactRegistryClient.getVersion(request);
}
Parameter | |
---|---|
Name | Description |
request |