Class OsLoginServiceClient (2.15.1)

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.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

OsLoginServiceClient(OsLoginServiceClient const &)

Copy and move support

Parameter
Name Description
OsLoginServiceClient const &

OsLoginServiceClient(OsLoginServiceClient &&)

Copy and move support

Parameter
Name Description
OsLoginServiceClient &&

OsLoginServiceClient(std::shared_ptr< OsLoginServiceConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< OsLoginServiceConnection >
opts Options

Operators

operator=(OsLoginServiceClient const &)

Copy and move support

Parameter
Name Description
OsLoginServiceClient const &
Returns
Type Description
OsLoginServiceClient &

operator=(OsLoginServiceClient &&)

Copy and move support

Parameter
Name Description
OsLoginServiceClient &&
Returns
Type Description
OsLoginServiceClient &

Functions

CreateSshPublicKey(std::string const &, google::cloud::oslogin::common::SshPublicKey const &, Options)

Create an SSH public key.

Parameters
Name Description
parent std::string const &

Required. The unique ID for the user in format users/{user}.

ssh_public_key google::cloud::oslogin::common::SshPublicKey const &

Required. The SSH public key and expiration time.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::oslogin::common::SshPublicKey >

the result of the RPC. The response message type (google.cloud.oslogin.common.SshPublicKey) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateSshPublicKey(google::cloud::oslogin::v1::CreateSshPublicKeyRequest const &, Options)

Create an SSH public key.

Parameters
Name Description
request google::cloud::oslogin::v1::CreateSshPublicKeyRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.oslogin.v1.CreateSshPublicKeyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::oslogin::common::SshPublicKey >

the result of the RPC. The response message type (google.cloud.oslogin.common.SshPublicKey) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

DeletePosixAccount(std::string const &, Options)

Deletes a POSIX account.

Parameters
Name Description
name std::string const &

Required. A reference to the POSIX account to update. POSIX accounts are identified by the project ID they are associated with. A reference to the POSIX account is in format users/{user}/projects/{project}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeletePosixAccount(google::cloud::oslogin::v1::DeletePosixAccountRequest const &, Options)

Deletes a POSIX account.

Parameters
Name Description
request google::cloud::oslogin::v1::DeletePosixAccountRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.oslogin.v1.DeletePosixAccountRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteSshPublicKey(std::string const &, Options)

Deletes an SSH public key.

Parameters
Name Description
name std::string const &

Required. The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format users/{user}/sshPublicKeys/{fingerprint}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteSshPublicKey(google::cloud::oslogin::v1::DeleteSshPublicKeyRequest const &, Options)

Deletes an SSH public key.

Parameters
Name Description
request google::cloud::oslogin::v1::DeleteSshPublicKeyRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.oslogin.v1.DeleteSshPublicKeyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

GetLoginProfile(std::string const &, Options)

Retrieves the profile information used for logging in to a virtual machine on Google Compute Engine.

Parameters
Name Description
name std::string const &

Required. The unique ID for the user in format users/{user}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::oslogin::v1::LoginProfile >

the result of the RPC. The response message type (google.cloud.oslogin.v1.LoginProfile) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetLoginProfile(google::cloud::oslogin::v1::GetLoginProfileRequest const &, Options)

Retrieves the profile information used for logging in to a virtual machine on Google Compute Engine.

Parameters
Name Description
request google::cloud::oslogin::v1::GetLoginProfileRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.oslogin.v1.GetLoginProfileRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::oslogin::v1::LoginProfile >

the result of the RPC. The response message type (google.cloud.oslogin.v1.LoginProfile) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetSshPublicKey(std::string const &, Options)

Retrieves an SSH public key.

Parameters
Name Description
name std::string const &

Required. The fingerprint of the public key to retrieve. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format users/{user}/sshPublicKeys/{fingerprint}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::oslogin::common::SshPublicKey >

the result of the RPC. The response message type (google.cloud.oslogin.common.SshPublicKey) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetSshPublicKey(google::cloud::oslogin::v1::GetSshPublicKeyRequest const &, Options)

Retrieves an SSH public key.

Parameters
Name Description
request google::cloud::oslogin::v1::GetSshPublicKeyRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.oslogin.v1.GetSshPublicKeyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::oslogin::common::SshPublicKey >

the result of the RPC. The response message type (google.cloud.oslogin.common.SshPublicKey) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ImportSshPublicKey(std::string const &, google::cloud::oslogin::common::SshPublicKey const &, Options)

Adds an SSH public key and returns the profile information.

Default POSIX account information is set when no username and UID exist as part of the login profile.

Parameters
Name Description
parent std::string const &

Required. The unique ID for the user in format users/{user}.

ssh_public_key google::cloud::oslogin::common::SshPublicKey const &

Optional. The SSH public key and expiration time.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::oslogin::v1::ImportSshPublicKeyResponse >

the result of the RPC. The response message type (google.cloud.oslogin.v1.ImportSshPublicKeyResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ImportSshPublicKey(std::string const &, google::cloud::oslogin::common::SshPublicKey const &, std::string const &, Options)

Adds an SSH public key and returns the profile information.

Default POSIX account information is set when no username and UID exist as part of the login profile.

Parameters
Name Description
parent std::string const &

Required. The unique ID for the user in format users/{user}.

ssh_public_key google::cloud::oslogin::common::SshPublicKey const &

Optional. The SSH public key and expiration time.

project_id std::string const &

The project ID of the Google Cloud Platform project.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::oslogin::v1::ImportSshPublicKeyResponse >

the result of the RPC. The response message type (google.cloud.oslogin.v1.ImportSshPublicKeyResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ImportSshPublicKey(google::cloud::oslogin::v1::ImportSshPublicKeyRequest const &, Options)

Adds an SSH public key and returns the profile information.

Default POSIX account information is set when no username and UID exist as part of the login profile.

Parameters
Name Description
request google::cloud::oslogin::v1::ImportSshPublicKeyRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.oslogin.v1.ImportSshPublicKeyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::oslogin::v1::ImportSshPublicKeyResponse >

the result of the RPC. The response message type (google.cloud.oslogin.v1.ImportSshPublicKeyResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateSshPublicKey(std::string const &, google::cloud::oslogin::common::SshPublicKey const &, Options)

Updates an SSH public key and returns the profile information.

This method supports patch semantics.

Parameters
Name Description
name std::string const &

Required. The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format users/{user}/sshPublicKeys/{fingerprint}.

ssh_public_key google::cloud::oslogin::common::SshPublicKey const &

Required. The SSH public key and expiration time.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::oslogin::common::SshPublicKey >

the result of the RPC. The response message type (google.cloud.oslogin.common.SshPublicKey) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateSshPublicKey(std::string const &, google::cloud::oslogin::common::SshPublicKey const &, google::protobuf::FieldMask const &, Options)

Updates an SSH public key and returns the profile information.

This method supports patch semantics.

Parameters
Name Description
name std::string const &

Required. The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format users/{user}/sshPublicKeys/{fingerprint}.

ssh_public_key google::cloud::oslogin::common::SshPublicKey const &

Required. The SSH public key and expiration time.

update_mask google::protobuf::FieldMask const &

Mask to control which fields get updated. Updates all if not present.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::oslogin::common::SshPublicKey >

the result of the RPC. The response message type (google.cloud.oslogin.common.SshPublicKey) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateSshPublicKey(google::cloud::oslogin::v1::UpdateSshPublicKeyRequest const &, Options)

Updates an SSH public key and returns the profile information.

This method supports patch semantics.

Parameters
Name Description
request google::cloud::oslogin::v1::UpdateSshPublicKeyRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.oslogin.v1.UpdateSshPublicKeyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::oslogin::common::SshPublicKey >

the result of the RPC. The response message type (google.cloud.oslogin.common.SshPublicKey) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.