Class ManagedIdentitiesServiceClient (0.3.7)

public class ManagedIdentitiesServiceClient implements BackgroundResource

Service Description: API Overview

The managedidentites.googleapis.com service implements the Google Cloud Managed Identites API for identity services (e.g. Microsoft Active Directory).

The Managed Identities service provides methods to manage (create/read/update/delete) domains, reset managed identities admin password, add/remove domain controllers in GCP regions and add/remove VPC peering.

Data Model

The Managed Identities service exposes the following resources:

  • Locations as global, named as follows: projects/{project_id}/locations/global.
  • Domains, named as follows: /projects/{project_id}/locations/global/domain/{domain_name}.

The {domain_name} refers to fully qualified domain name in the customer project e.g. mydomain.myorganization.com, with the following restrictions:

* Must contain only lowercase letters, numbers, periods and hyphens. * Must start with a letter. * Must contain between 2-64 characters. * Must end with a number or a letter. * Must not start with period. * First segement length (mydomain form example above) shouldn't exceed 15 chars. * The last segment cannot be fully numeric. * Must be unique within the customer project.

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:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
   ResetAdminPasswordResponse response = managedIdentitiesServiceClient.resetAdminPassword(name);
 }
 

Note: close() needs to be called on the ManagedIdentitiesServiceClient 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:

  1. 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.
  2. 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.
  3. 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 ManagedIdentitiesServiceSettings to create(). For example:

To customize credentials:


 ManagedIdentitiesServiceSettings managedIdentitiesServiceSettings =
     ManagedIdentitiesServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create(managedIdentitiesServiceSettings);
 

To customize the endpoint:


 ManagedIdentitiesServiceSettings managedIdentitiesServiceSettings =
     ManagedIdentitiesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create(managedIdentitiesServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > ManagedIdentitiesServiceClient

Implements

BackgroundResource

Constructors

ManagedIdentitiesServiceClient(ManagedIdentitiesServiceSettings settings)

protected ManagedIdentitiesServiceClient(ManagedIdentitiesServiceSettings settings)

Constructs an instance of ManagedIdentitiesServiceClient, 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
NameDescription
settingsManagedIdentitiesServiceSettings

ManagedIdentitiesServiceClient(ManagedIdentitiesServiceStub stub)

protected ManagedIdentitiesServiceClient(ManagedIdentitiesServiceStub stub)
Parameter
NameDescription
stubManagedIdentitiesServiceStub

Methods

attachTrustAsync(AttachTrustRequest request)

public final OperationFuture<Domain,OpMetadata> attachTrustAsync(AttachTrustRequest request)

Adds an AD trust to a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   AttachTrustRequest request =
       AttachTrustRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .setTrust(Trust.newBuilder().build())
           .build();
   Domain response = managedIdentitiesServiceClient.attachTrustAsync(request).get();
 }
 
Parameter
NameDescription
requestAttachTrustRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

attachTrustAsync(DomainName name, Trust trust)

public final OperationFuture<Domain,OpMetadata> attachTrustAsync(DomainName name, Trust trust)

Adds an AD trust to a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
   Trust trust = Trust.newBuilder().build();
   Domain response = managedIdentitiesServiceClient.attachTrustAsync(name, trust).get();
 }
 
Parameters
NameDescription
nameDomainName

Required. The resource domain name, project name and location using the form: projects/{project_id}/locations/global/domains/{domain_name}

trustTrust

Required. The domain trust resource.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

attachTrustAsync(String name, Trust trust)

public final OperationFuture<Domain,OpMetadata> attachTrustAsync(String name, Trust trust)

Adds an AD trust to a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
   Trust trust = Trust.newBuilder().build();
   Domain response = managedIdentitiesServiceClient.attachTrustAsync(name, trust).get();
 }
 
Parameters
NameDescription
nameString

Required. The resource domain name, project name and location using the form: projects/{project_id}/locations/global/domains/{domain_name}

trustTrust

Required. The domain trust resource.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

attachTrustCallable()

public final UnaryCallable<AttachTrustRequest,Operation> attachTrustCallable()

Adds an AD trust to a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   AttachTrustRequest request =
       AttachTrustRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .setTrust(Trust.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       managedIdentitiesServiceClient.attachTrustCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<AttachTrustRequest,Operation>

attachTrustOperationCallable()

public final OperationCallable<AttachTrustRequest,Domain,OpMetadata> attachTrustOperationCallable()

Adds an AD trust to a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   AttachTrustRequest request =
       AttachTrustRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .setTrust(Trust.newBuilder().build())
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<AttachTrustRequest,Domain,OpMetadata>

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

create()

public static final ManagedIdentitiesServiceClient create()

Constructs an instance of ManagedIdentitiesServiceClient with default settings.

Returns
TypeDescription
ManagedIdentitiesServiceClient
Exceptions
TypeDescription
IOException

create(ManagedIdentitiesServiceSettings settings)

public static final ManagedIdentitiesServiceClient create(ManagedIdentitiesServiceSettings settings)

Constructs an instance of ManagedIdentitiesServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsManagedIdentitiesServiceSettings
Returns
TypeDescription
ManagedIdentitiesServiceClient
Exceptions
TypeDescription
IOException

create(ManagedIdentitiesServiceStub stub)

public static final ManagedIdentitiesServiceClient create(ManagedIdentitiesServiceStub stub)

Constructs an instance of ManagedIdentitiesServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(ManagedIdentitiesServiceSettings).

Parameter
NameDescription
stubManagedIdentitiesServiceStub
Returns
TypeDescription
ManagedIdentitiesServiceClient

createMicrosoftAdDomainAsync(CreateMicrosoftAdDomainRequest request)

public final OperationFuture<Domain,OpMetadata> createMicrosoftAdDomainAsync(CreateMicrosoftAdDomainRequest request)

Creates a Microsoft AD domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   CreateMicrosoftAdDomainRequest request =
       CreateMicrosoftAdDomainRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDomainName("domainName-1244085905")
           .setDomain(Domain.newBuilder().build())
           .build();
   Domain response = managedIdentitiesServiceClient.createMicrosoftAdDomainAsync(request).get();
 }
 
Parameter
NameDescription
requestCreateMicrosoftAdDomainRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

createMicrosoftAdDomainAsync(LocationName parent, String domainName, Domain domain)

public final OperationFuture<Domain,OpMetadata> createMicrosoftAdDomainAsync(LocationName parent, String domainName, Domain domain)

Creates a Microsoft AD domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   String domainName = "domainName-1244085905";
   Domain domain = Domain.newBuilder().build();
   Domain response =
       managedIdentitiesServiceClient
           .createMicrosoftAdDomainAsync(parent, domainName, domain)
           .get();
 }
 
Parameters
NameDescription
parentLocationName

Required. The resource project name and location using the form: projects/{project_id}/locations/global

domainNameString

Required. The fully qualified domain name. e.g. mydomain.myorganization.com, with the following restrictions:

* Must contain only lowercase letters, numbers, periods and hyphens. * Must start with a letter. * Must contain between 2-64 characters. * Must end with a number or a letter. * Must not start with period. * First segement length (mydomain form example above) shouldn't exceed 15 chars. * The last segment cannot be fully numeric. * Must be unique within the customer project.

domainDomain

Required. A Managed Identity domain resource.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

createMicrosoftAdDomainAsync(String parent, String domainName, Domain domain)

public final OperationFuture<Domain,OpMetadata> createMicrosoftAdDomainAsync(String parent, String domainName, Domain domain)

Creates a Microsoft AD domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   String domainName = "domainName-1244085905";
   Domain domain = Domain.newBuilder().build();
   Domain response =
       managedIdentitiesServiceClient
           .createMicrosoftAdDomainAsync(parent, domainName, domain)
           .get();
 }
 
Parameters
NameDescription
parentString

Required. The resource project name and location using the form: projects/{project_id}/locations/global

domainNameString

Required. The fully qualified domain name. e.g. mydomain.myorganization.com, with the following restrictions:

* Must contain only lowercase letters, numbers, periods and hyphens. * Must start with a letter. * Must contain between 2-64 characters. * Must end with a number or a letter. * Must not start with period. * First segement length (mydomain form example above) shouldn't exceed 15 chars. * The last segment cannot be fully numeric. * Must be unique within the customer project.

domainDomain

Required. A Managed Identity domain resource.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

createMicrosoftAdDomainCallable()

public final UnaryCallable<CreateMicrosoftAdDomainRequest,Operation> createMicrosoftAdDomainCallable()

Creates a Microsoft AD domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   CreateMicrosoftAdDomainRequest request =
       CreateMicrosoftAdDomainRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDomainName("domainName-1244085905")
           .setDomain(Domain.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       managedIdentitiesServiceClient.createMicrosoftAdDomainCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateMicrosoftAdDomainRequest,Operation>

createMicrosoftAdDomainOperationCallable()

public final OperationCallable<CreateMicrosoftAdDomainRequest,Domain,OpMetadata> createMicrosoftAdDomainOperationCallable()

Creates a Microsoft AD domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   CreateMicrosoftAdDomainRequest request =
       CreateMicrosoftAdDomainRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDomainName("domainName-1244085905")
           .setDomain(Domain.newBuilder().build())
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<CreateMicrosoftAdDomainRequest,Domain,OpMetadata>

deleteDomainAsync(DeleteDomainRequest request)

public final OperationFuture<Empty,OpMetadata> deleteDomainAsync(DeleteDomainRequest request)

Deletes a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DeleteDomainRequest request =
       DeleteDomainRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .build();
   managedIdentitiesServiceClient.deleteDomainAsync(request).get();
 }
 
Parameter
NameDescription
requestDeleteDomainRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Empty,OpMetadata>

deleteDomainAsync(DomainName name)

public final OperationFuture<Empty,OpMetadata> deleteDomainAsync(DomainName name)

Deletes a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
   managedIdentitiesServiceClient.deleteDomainAsync(name).get();
 }
 
Parameter
NameDescription
nameDomainName

Required. The domain resource name using the form: projects/{project_id}/locations/global/domains/{domain_name}

Returns
TypeDescription
OperationFuture<Empty,OpMetadata>

deleteDomainAsync(String name)

public final OperationFuture<Empty,OpMetadata> deleteDomainAsync(String name)

Deletes a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
   managedIdentitiesServiceClient.deleteDomainAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. The domain resource name using the form: projects/{project_id}/locations/global/domains/{domain_name}

Returns
TypeDescription
OperationFuture<Empty,OpMetadata>

deleteDomainCallable()

public final UnaryCallable<DeleteDomainRequest,Operation> deleteDomainCallable()

Deletes a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DeleteDomainRequest request =
       DeleteDomainRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .build();
   ApiFuture<Operation> future =
       managedIdentitiesServiceClient.deleteDomainCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteDomainRequest,Operation>

deleteDomainOperationCallable()

public final OperationCallable<DeleteDomainRequest,Empty,OpMetadata> deleteDomainOperationCallable()

Deletes a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DeleteDomainRequest request =
       DeleteDomainRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<DeleteDomainRequest,Empty,OpMetadata>

detachTrustAsync(DetachTrustRequest request)

public final OperationFuture<Domain,OpMetadata> detachTrustAsync(DetachTrustRequest request)

Removes an AD trust.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DetachTrustRequest request =
       DetachTrustRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .setTrust(Trust.newBuilder().build())
           .build();
   Domain response = managedIdentitiesServiceClient.detachTrustAsync(request).get();
 }
 
Parameter
NameDescription
requestDetachTrustRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

detachTrustAsync(DomainName name, Trust trust)

public final OperationFuture<Domain,OpMetadata> detachTrustAsync(DomainName name, Trust trust)

Removes an AD trust.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
   Trust trust = Trust.newBuilder().build();
   Domain response = managedIdentitiesServiceClient.detachTrustAsync(name, trust).get();
 }
 
Parameters
NameDescription
nameDomainName

Required. The resource domain name, project name, and location using the form: projects/{project_id}/locations/global/domains/{domain_name}

trustTrust

Required. The domain trust resource to removed.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

detachTrustAsync(String name, Trust trust)

public final OperationFuture<Domain,OpMetadata> detachTrustAsync(String name, Trust trust)

Removes an AD trust.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
   Trust trust = Trust.newBuilder().build();
   Domain response = managedIdentitiesServiceClient.detachTrustAsync(name, trust).get();
 }
 
Parameters
NameDescription
nameString

Required. The resource domain name, project name, and location using the form: projects/{project_id}/locations/global/domains/{domain_name}

trustTrust

Required. The domain trust resource to removed.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

detachTrustCallable()

public final UnaryCallable<DetachTrustRequest,Operation> detachTrustCallable()

Removes an AD trust.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DetachTrustRequest request =
       DetachTrustRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .setTrust(Trust.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       managedIdentitiesServiceClient.detachTrustCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DetachTrustRequest,Operation>

detachTrustOperationCallable()

public final OperationCallable<DetachTrustRequest,Domain,OpMetadata> detachTrustOperationCallable()

Removes an AD trust.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DetachTrustRequest request =
       DetachTrustRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .setTrust(Trust.newBuilder().build())
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<DetachTrustRequest,Domain,OpMetadata>

getDomain(DomainName name)

public final Domain getDomain(DomainName name)

Gets information about a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
   Domain response = managedIdentitiesServiceClient.getDomain(name);
 }
 
Parameter
NameDescription
nameDomainName

Required. The domain resource name using the form: projects/{project_id}/locations/global/domains/{domain_name}

Returns
TypeDescription
Domain

getDomain(GetDomainRequest request)

public final Domain getDomain(GetDomainRequest request)

Gets information about a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   GetDomainRequest request =
       GetDomainRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .build();
   Domain response = managedIdentitiesServiceClient.getDomain(request);
 }
 
Parameter
NameDescription
requestGetDomainRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Domain

getDomain(String name)

public final Domain getDomain(String name)

Gets information about a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
   Domain response = managedIdentitiesServiceClient.getDomain(name);
 }
 
Parameter
NameDescription
nameString

Required. The domain resource name using the form: projects/{project_id}/locations/global/domains/{domain_name}

Returns
TypeDescription
Domain

getDomainCallable()

public final UnaryCallable<GetDomainRequest,Domain> getDomainCallable()

Gets information about a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   GetDomainRequest request =
       GetDomainRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .build();
   ApiFuture<Domain> future =
       managedIdentitiesServiceClient.getDomainCallable().futureCall(request);
   // Do something.
   Domain response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetDomainRequest,Domain>

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
TypeDescription
OperationsClient

getSettings()

public final ManagedIdentitiesServiceSettings getSettings()
Returns
TypeDescription
ManagedIdentitiesServiceSettings

getStub()

public ManagedIdentitiesServiceStub getStub()
Returns
TypeDescription
ManagedIdentitiesServiceStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listDomains(ListDomainsRequest request)

public final ManagedIdentitiesServiceClient.ListDomainsPagedResponse listDomains(ListDomainsRequest request)

Lists domains in a project.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   ListDomainsRequest request =
       ListDomainsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Domain element : managedIdentitiesServiceClient.listDomains(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListDomainsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ManagedIdentitiesServiceClient.ListDomainsPagedResponse

listDomains(LocationName parent)

public final ManagedIdentitiesServiceClient.ListDomainsPagedResponse listDomains(LocationName parent)

Lists domains in a project.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Domain element : managedIdentitiesServiceClient.listDomains(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. The resource name of the domain location using the form: projects/{project_id}/locations/global

Returns
TypeDescription
ManagedIdentitiesServiceClient.ListDomainsPagedResponse

listDomains(String parent)

public final ManagedIdentitiesServiceClient.ListDomainsPagedResponse listDomains(String parent)

Lists domains in a project.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Domain element : managedIdentitiesServiceClient.listDomains(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The resource name of the domain location using the form: projects/{project_id}/locations/global

Returns
TypeDescription
ManagedIdentitiesServiceClient.ListDomainsPagedResponse

listDomainsCallable()

public final UnaryCallable<ListDomainsRequest,ListDomainsResponse> listDomainsCallable()

Lists domains in a project.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   ListDomainsRequest request =
       ListDomainsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListDomainsResponse response =
         managedIdentitiesServiceClient.listDomainsCallable().call(request);
     for (Domain element : response.getResponsesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDomainsRequest,ListDomainsResponse>

listDomainsPagedCallable()

public final UnaryCallable<ListDomainsRequest,ManagedIdentitiesServiceClient.ListDomainsPagedResponse> listDomainsPagedCallable()

Lists domains in a project.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   ListDomainsRequest request =
       ListDomainsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Domain> future =
       managedIdentitiesServiceClient.listDomainsPagedCallable().futureCall(request);
   // Do something.
   for (Domain element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDomainsRequest,ListDomainsPagedResponse>

reconfigureTrustAsync(DomainName name, String targetDomainName, List<String> targetDnsIpAddresses)

public final OperationFuture<Domain,OpMetadata> reconfigureTrustAsync(DomainName name, String targetDomainName, List<String> targetDnsIpAddresses)

Updates the DNS conditional forwarder.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
   String targetDomainName = "targetDomainName2065239520";
   List<String> targetDnsIpAddresses = new ArrayList<>();
   Domain response =
       managedIdentitiesServiceClient
           .reconfigureTrustAsync(name, targetDomainName, targetDnsIpAddresses)
           .get();
 }
 
Parameters
NameDescription
nameDomainName

Required. The resource domain name, project name and location using the form: projects/{project_id}/locations/global/domains/{domain_name}

targetDomainNameString

Required. The fully-qualified target domain name which will be in trust with current domain.

targetDnsIpAddressesList<String>

Required. The target DNS server IP addresses to resolve the remote domain involved in the trust.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

reconfigureTrustAsync(ReconfigureTrustRequest request)

public final OperationFuture<Domain,OpMetadata> reconfigureTrustAsync(ReconfigureTrustRequest request)

Updates the DNS conditional forwarder.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   ReconfigureTrustRequest request =
       ReconfigureTrustRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .setTargetDomainName("targetDomainName2065239520")
           .addAllTargetDnsIpAddresses(new ArrayList<String>())
           .build();
   Domain response = managedIdentitiesServiceClient.reconfigureTrustAsync(request).get();
 }
 
Parameter
NameDescription
requestReconfigureTrustRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

reconfigureTrustAsync(String name, String targetDomainName, List<String> targetDnsIpAddresses)

public final OperationFuture<Domain,OpMetadata> reconfigureTrustAsync(String name, String targetDomainName, List<String> targetDnsIpAddresses)

Updates the DNS conditional forwarder.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
   String targetDomainName = "targetDomainName2065239520";
   List<String> targetDnsIpAddresses = new ArrayList<>();
   Domain response =
       managedIdentitiesServiceClient
           .reconfigureTrustAsync(name, targetDomainName, targetDnsIpAddresses)
           .get();
 }
 
Parameters
NameDescription
nameString

Required. The resource domain name, project name and location using the form: projects/{project_id}/locations/global/domains/{domain_name}

targetDomainNameString

Required. The fully-qualified target domain name which will be in trust with current domain.

targetDnsIpAddressesList<String>

Required. The target DNS server IP addresses to resolve the remote domain involved in the trust.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

reconfigureTrustCallable()

public final UnaryCallable<ReconfigureTrustRequest,Operation> reconfigureTrustCallable()

Updates the DNS conditional forwarder.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   ReconfigureTrustRequest request =
       ReconfigureTrustRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .setTargetDomainName("targetDomainName2065239520")
           .addAllTargetDnsIpAddresses(new ArrayList<String>())
           .build();
   ApiFuture<Operation> future =
       managedIdentitiesServiceClient.reconfigureTrustCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ReconfigureTrustRequest,Operation>

reconfigureTrustOperationCallable()

public final OperationCallable<ReconfigureTrustRequest,Domain,OpMetadata> reconfigureTrustOperationCallable()

Updates the DNS conditional forwarder.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   ReconfigureTrustRequest request =
       ReconfigureTrustRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .setTargetDomainName("targetDomainName2065239520")
           .addAllTargetDnsIpAddresses(new ArrayList<String>())
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<ReconfigureTrustRequest,Domain,OpMetadata>

resetAdminPassword(DomainName name)

public final ResetAdminPasswordResponse resetAdminPassword(DomainName name)

Resets a domain's administrator password.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
   ResetAdminPasswordResponse response = managedIdentitiesServiceClient.resetAdminPassword(name);
 }
 
Parameter
NameDescription
nameDomainName

Required. The domain resource name using the form: projects/{project_id}/locations/global/domains/{domain_name}

Returns
TypeDescription
ResetAdminPasswordResponse

resetAdminPassword(ResetAdminPasswordRequest request)

public final ResetAdminPasswordResponse resetAdminPassword(ResetAdminPasswordRequest request)

Resets a domain's administrator password.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   ResetAdminPasswordRequest request =
       ResetAdminPasswordRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .build();
   ResetAdminPasswordResponse response =
       managedIdentitiesServiceClient.resetAdminPassword(request);
 }
 
Parameter
NameDescription
requestResetAdminPasswordRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ResetAdminPasswordResponse

resetAdminPassword(String name)

public final ResetAdminPasswordResponse resetAdminPassword(String name)

Resets a domain's administrator password.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
   ResetAdminPasswordResponse response = managedIdentitiesServiceClient.resetAdminPassword(name);
 }
 
Parameter
NameDescription
nameString

Required. The domain resource name using the form: projects/{project_id}/locations/global/domains/{domain_name}

Returns
TypeDescription
ResetAdminPasswordResponse

resetAdminPasswordCallable()

public final UnaryCallable<ResetAdminPasswordRequest,ResetAdminPasswordResponse> resetAdminPasswordCallable()

Resets a domain's administrator password.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   ResetAdminPasswordRequest request =
       ResetAdminPasswordRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<ResetAdminPasswordRequest,ResetAdminPasswordResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateDomainAsync(Domain domain, FieldMask updateMask)

public final OperationFuture<Domain,OpMetadata> updateDomainAsync(Domain domain, FieldMask updateMask)

Updates the metadata and configuration of a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   Domain domain = Domain.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Domain response = managedIdentitiesServiceClient.updateDomainAsync(domain, updateMask).get();
 }
 
Parameters
NameDescription
domainDomain

Required. Domain message with updated fields. Only supported fields specified in update_mask are updated.

updateMaskFieldMask

Required. Mask of fields to update. At least one path must be supplied in this field. The elements of the repeated paths field may only include fields from Domain: * labels * locations * authorized_networks

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

updateDomainAsync(UpdateDomainRequest request)

public final OperationFuture<Domain,OpMetadata> updateDomainAsync(UpdateDomainRequest request)

Updates the metadata and configuration of a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   UpdateDomainRequest request =
       UpdateDomainRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setDomain(Domain.newBuilder().build())
           .build();
   Domain response = managedIdentitiesServiceClient.updateDomainAsync(request).get();
 }
 
Parameter
NameDescription
requestUpdateDomainRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

updateDomainCallable()

public final UnaryCallable<UpdateDomainRequest,Operation> updateDomainCallable()

Updates the metadata and configuration of a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   UpdateDomainRequest request =
       UpdateDomainRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setDomain(Domain.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       managedIdentitiesServiceClient.updateDomainCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateDomainRequest,Operation>

updateDomainOperationCallable()

public final OperationCallable<UpdateDomainRequest,Domain,OpMetadata> updateDomainOperationCallable()

Updates the metadata and configuration of a domain.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   UpdateDomainRequest request =
       UpdateDomainRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setDomain(Domain.newBuilder().build())
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<UpdateDomainRequest,Domain,OpMetadata>

validateTrustAsync(DomainName name, Trust trust)

public final OperationFuture<Domain,OpMetadata> validateTrustAsync(DomainName name, Trust trust)

Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   DomainName name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]");
   Trust trust = Trust.newBuilder().build();
   Domain response = managedIdentitiesServiceClient.validateTrustAsync(name, trust).get();
 }
 
Parameters
NameDescription
nameDomainName

Required. The resource domain name, project name, and location using the form: projects/{project_id}/locations/global/domains/{domain_name}

trustTrust

Required. The domain trust to validate trust state for.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

validateTrustAsync(ValidateTrustRequest request)

public final OperationFuture<Domain,OpMetadata> validateTrustAsync(ValidateTrustRequest request)

Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   ValidateTrustRequest request =
       ValidateTrustRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .setTrust(Trust.newBuilder().build())
           .build();
   Domain response = managedIdentitiesServiceClient.validateTrustAsync(request).get();
 }
 
Parameter
NameDescription
requestValidateTrustRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

validateTrustAsync(String name, Trust trust)

public final OperationFuture<Domain,OpMetadata> validateTrustAsync(String name, Trust trust)

Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   String name = DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString();
   Trust trust = Trust.newBuilder().build();
   Domain response = managedIdentitiesServiceClient.validateTrustAsync(name, trust).get();
 }
 
Parameters
NameDescription
nameString

Required. The resource domain name, project name, and location using the form: projects/{project_id}/locations/global/domains/{domain_name}

trustTrust

Required. The domain trust to validate trust state for.

Returns
TypeDescription
OperationFuture<Domain,OpMetadata>

validateTrustCallable()

public final UnaryCallable<ValidateTrustRequest,Operation> validateTrustCallable()

Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   ValidateTrustRequest request =
       ValidateTrustRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .setTrust(Trust.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       managedIdentitiesServiceClient.validateTrustCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ValidateTrustRequest,Operation>

validateTrustOperationCallable()

public final OperationCallable<ValidateTrustRequest,Domain,OpMetadata> validateTrustOperationCallable()

Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests.

Sample code:


 try (ManagedIdentitiesServiceClient managedIdentitiesServiceClient =
     ManagedIdentitiesServiceClient.create()) {
   ValidateTrustRequest request =
       ValidateTrustRequest.newBuilder()
           .setName(DomainName.of("[PROJECT]", "[LOCATION]", "[DOMAIN]").toString())
           .setTrust(Trust.newBuilder().build())
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<ValidateTrustRequest,Domain,OpMetadata>