Package com.google.cloud.oslogin.v1 (2.15.0)

A client to Cloud OS Login API

The interfaces provided are listed below, along with usage samples.

OsLoginServiceClient

Service Description: Cloud OS Login API

The Cloud OS Login API allows you to manage users and their associated SSH public keys for logging into virtual machines on Google Cloud Platform.

Sample for OsLoginServiceClient:


 // 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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
   UserName parent = UserName.of("[USER]");
   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
   OsLoginProto.SshPublicKey response =
       osLoginServiceClient.createSshPublicKey(parent, sshPublicKey);
 }
 

Classes

CreateSshPublicKeyRequest

A request message for creating an SSH public key.

Protobuf type google.cloud.oslogin.v1.CreateSshPublicKeyRequest

CreateSshPublicKeyRequest.Builder

A request message for creating an SSH public key.

Protobuf type google.cloud.oslogin.v1.CreateSshPublicKeyRequest

DeletePosixAccountRequest

A request message for deleting a POSIX account entry.

Protobuf type google.cloud.oslogin.v1.DeletePosixAccountRequest

DeletePosixAccountRequest.Builder

A request message for deleting a POSIX account entry.

Protobuf type google.cloud.oslogin.v1.DeletePosixAccountRequest

DeleteSshPublicKeyRequest

A request message for deleting an SSH public key.

Protobuf type google.cloud.oslogin.v1.DeleteSshPublicKeyRequest

DeleteSshPublicKeyRequest.Builder

A request message for deleting an SSH public key.

Protobuf type google.cloud.oslogin.v1.DeleteSshPublicKeyRequest

FingerprintName

FingerprintName.Builder

Builder for FingerprintName.

GetLoginProfileRequest

A request message for retrieving the login profile information for a user.

Protobuf type google.cloud.oslogin.v1.GetLoginProfileRequest

GetLoginProfileRequest.Builder

A request message for retrieving the login profile information for a user.

Protobuf type google.cloud.oslogin.v1.GetLoginProfileRequest

GetSshPublicKeyRequest

A request message for retrieving an SSH public key.

Protobuf type google.cloud.oslogin.v1.GetSshPublicKeyRequest

GetSshPublicKeyRequest.Builder

A request message for retrieving an SSH public key.

Protobuf type google.cloud.oslogin.v1.GetSshPublicKeyRequest

ImportSshPublicKeyRequest

A request message for importing an SSH public key.

Protobuf type google.cloud.oslogin.v1.ImportSshPublicKeyRequest

ImportSshPublicKeyRequest.Builder

A request message for importing an SSH public key.

Protobuf type google.cloud.oslogin.v1.ImportSshPublicKeyRequest

ImportSshPublicKeyResponse

A response message for importing an SSH public key.

Protobuf type google.cloud.oslogin.v1.ImportSshPublicKeyResponse

ImportSshPublicKeyResponse.Builder

A response message for importing an SSH public key.

Protobuf type google.cloud.oslogin.v1.ImportSshPublicKeyResponse

LoginProfile

The user profile information used for logging in to a virtual machine on Google Compute Engine.

Protobuf type google.cloud.oslogin.v1.LoginProfile

LoginProfile.Builder

The user profile information used for logging in to a virtual machine on Google Compute Engine.

Protobuf type google.cloud.oslogin.v1.LoginProfile

OsLoginProto

OsLoginServiceClient

Service Description: Cloud OS Login API

The Cloud OS Login API allows you to manage users and their associated SSH public keys for logging into virtual machines on Google Cloud Platform.

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 (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
   UserName parent = UserName.of("[USER]");
   OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build();
   OsLoginProto.SshPublicKey response =
       osLoginServiceClient.createSshPublicKey(parent, sshPublicKey);
 }
 

Note: close() needs to be called on the OsLoginServiceClient 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 OsLoginServiceSettings 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
 OsLoginServiceSettings osLoginServiceSettings =
     OsLoginServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create(osLoginServiceSettings);
 

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
 OsLoginServiceSettings osLoginServiceSettings =
     OsLoginServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create(osLoginServiceSettings);
 

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
 OsLoginServiceSettings osLoginServiceSettings =
     OsLoginServiceSettings.newHttpJsonBuilder().build();
 OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create(osLoginServiceSettings);
 

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

OsLoginServiceGrpc

Cloud OS Login API The Cloud OS Login API allows you to manage users and their associated SSH public keys for logging into virtual machines on Google Cloud Platform.

OsLoginServiceGrpc.OsLoginServiceBlockingStub

A stub to allow clients to do synchronous rpc calls to service OsLoginService.

Cloud OS Login API The Cloud OS Login API allows you to manage users and their associated SSH public keys for logging into virtual machines on Google Cloud Platform.

OsLoginServiceGrpc.OsLoginServiceFutureStub

A stub to allow clients to do ListenableFuture-style rpc calls to service OsLoginService.

Cloud OS Login API The Cloud OS Login API allows you to manage users and their associated SSH public keys for logging into virtual machines on Google Cloud Platform.

OsLoginServiceGrpc.OsLoginServiceImplBase

Base class for the server implementation of the service OsLoginService.

Cloud OS Login API The Cloud OS Login API allows you to manage users and their associated SSH public keys for logging into virtual machines on Google Cloud Platform.

OsLoginServiceGrpc.OsLoginServiceStub

A stub to allow clients to do asynchronous rpc calls to service OsLoginService.

Cloud OS Login API The Cloud OS Login API allows you to manage users and their associated SSH public keys for logging into virtual machines on Google Cloud Platform.

OsLoginServiceSettings

Settings class to configure an instance of OsLoginServiceClient.

The default instance has everything set to sensible defaults:

  • The default service address (oslogin.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of createSshPublicKey to 30 seconds:


 // 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
 OsLoginServiceSettings.Builder osLoginServiceSettingsBuilder =
     OsLoginServiceSettings.newBuilder();
 osLoginServiceSettingsBuilder
     .createSshPublicKeySettings()
     .setRetrySettings(
         osLoginServiceSettingsBuilder
             .createSshPublicKeySettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 OsLoginServiceSettings osLoginServiceSettings = osLoginServiceSettingsBuilder.build();
 

OsLoginServiceSettings.Builder

Builder for OsLoginServiceSettings.

PosixAccountName

PosixAccountName.Builder

Builder for users/{user}/projects/{project}.

ProjectName

ProjectName.Builder

Builder for ProjectName.

SshPublicKeyName

SshPublicKeyName.Builder

Builder for users/{user}/sshPublicKeys/{fingerprint}.

UpdateSshPublicKeyRequest

A request message for updating an SSH public key.

Protobuf type google.cloud.oslogin.v1.UpdateSshPublicKeyRequest

UpdateSshPublicKeyRequest.Builder

A request message for updating an SSH public key.

Protobuf type google.cloud.oslogin.v1.UpdateSshPublicKeyRequest

UserName

UserName.Builder

Builder for users/{user}.

Interfaces

CreateSshPublicKeyRequestOrBuilder

DeletePosixAccountRequestOrBuilder

DeleteSshPublicKeyRequestOrBuilder

GetLoginProfileRequestOrBuilder

GetSshPublicKeyRequestOrBuilder

ImportSshPublicKeyRequestOrBuilder

ImportSshPublicKeyResponseOrBuilder

LoginProfileOrBuilder

OsLoginServiceGrpc.AsyncService

Cloud OS Login API The Cloud OS Login API allows you to manage users and their associated SSH public keys for logging into virtual machines on Google Cloud Platform.

UpdateSshPublicKeyRequestOrBuilder