Cloud OS Login V1beta API - Class Google::Cloud::OsLogin::V1beta::OsLoginService::Rest::Client (v0.9.0)

Reference documentation and code samples for the Cloud OS Login V1beta API class Google::Cloud::OsLogin::V1beta::OsLoginService::Rest::Client.

REST client for the OsLoginService service.

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.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the OsLoginService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all OsLoginService clients
::Google::Cloud::OsLogin::V1beta::OsLoginService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the OsLoginService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_ssh_public_key

def create_ssh_public_key(request, options = nil) -> ::Google::Cloud::OsLogin::Common::SshPublicKey
def create_ssh_public_key(parent: nil, ssh_public_key: nil) -> ::Google::Cloud::OsLogin::Common::SshPublicKey

Create an SSH public key

Overloads
def create_ssh_public_key(request, options = nil) -> ::Google::Cloud::OsLogin::Common::SshPublicKey
Pass arguments to create_ssh_public_key via a request object, either of type CreateSshPublicKeyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_ssh_public_key(parent: nil, ssh_public_key: nil) -> ::Google::Cloud::OsLogin::Common::SshPublicKey
Pass arguments to create_ssh_public_key via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#delete_posix_account

def delete_posix_account(request, options = nil) -> ::Google::Protobuf::Empty
def delete_posix_account(name: nil) -> ::Google::Protobuf::Empty

Deletes a POSIX account.

Overloads
def delete_posix_account(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_posix_account via a request object, either of type DeletePosixAccountRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::OsLogin::V1beta::DeletePosixAccountRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_posix_account(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_posix_account via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — 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}.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#delete_ssh_public_key

def delete_ssh_public_key(request, options = nil) -> ::Google::Protobuf::Empty
def delete_ssh_public_key(name: nil) -> ::Google::Protobuf::Empty

Deletes an SSH public key.

Overloads
def delete_ssh_public_key(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_ssh_public_key via a request object, either of type DeleteSshPublicKeyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::OsLogin::V1beta::DeleteSshPublicKeyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_ssh_public_key(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_ssh_public_key via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — 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}.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_login_profile

def get_login_profile(request, options = nil) -> ::Google::Cloud::OsLogin::V1beta::LoginProfile
def get_login_profile(name: nil, project_id: nil, system_id: nil, view: nil) -> ::Google::Cloud::OsLogin::V1beta::LoginProfile

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

Overloads
def get_login_profile(request, options = nil) -> ::Google::Cloud::OsLogin::V1beta::LoginProfile
Pass arguments to get_login_profile via a request object, either of type GetLoginProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::OsLogin::V1beta::GetLoginProfileRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_login_profile(name: nil, project_id: nil, system_id: nil, view: nil) -> ::Google::Cloud::OsLogin::V1beta::LoginProfile
Pass arguments to get_login_profile via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The unique ID for the user in format users/{user}.
  • project_id (::String) — The project ID of the Google Cloud Platform project.
  • system_id (::String) — A system ID for filtering the results of the request.
  • view (::Google::Cloud::OsLogin::V1beta::LoginProfileView) — The view configures whether to retrieve security keys information.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_ssh_public_key

def get_ssh_public_key(request, options = nil) -> ::Google::Cloud::OsLogin::Common::SshPublicKey
def get_ssh_public_key(name: nil) -> ::Google::Cloud::OsLogin::Common::SshPublicKey

Retrieves an SSH public key.

Overloads
def get_ssh_public_key(request, options = nil) -> ::Google::Cloud::OsLogin::Common::SshPublicKey
Pass arguments to get_ssh_public_key via a request object, either of type GetSshPublicKeyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::OsLogin::V1beta::GetSshPublicKeyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_ssh_public_key(name: nil) -> ::Google::Cloud::OsLogin::Common::SshPublicKey
Pass arguments to get_ssh_public_key via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — 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}.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#import_ssh_public_key

def import_ssh_public_key(request, options = nil) -> ::Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyResponse
def import_ssh_public_key(parent: nil, ssh_public_key: nil, project_id: nil, view: nil) -> ::Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyResponse

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.

Overloads
def import_ssh_public_key(request, options = nil) -> ::Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyResponse
Pass arguments to import_ssh_public_key via a request object, either of type ImportSshPublicKeyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def import_ssh_public_key(parent: nil, ssh_public_key: nil, project_id: nil, view: nil) -> ::Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyResponse
Pass arguments to import_ssh_public_key via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#initialize

def initialize() { |config| ... } -> Client

Create a new OsLoginService REST client object.

Yields
  • (config) — Configure the OsLoginService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::OsLogin::V1beta::OsLoginService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::OsLogin::V1beta::OsLoginService::Rest::Client.new do |config|
  config.timeout = 10.0
end

#sign_ssh_public_key

def sign_ssh_public_key(request, options = nil) -> ::Google::Cloud::OsLogin::V1beta::SignSshPublicKeyResponse
def sign_ssh_public_key(ssh_public_key: nil, parent: nil) -> ::Google::Cloud::OsLogin::V1beta::SignSshPublicKeyResponse

Signs an SSH public key for a user to authenticate to an instance.

Overloads
def sign_ssh_public_key(request, options = nil) -> ::Google::Cloud::OsLogin::V1beta::SignSshPublicKeyResponse
Pass arguments to sign_ssh_public_key via a request object, either of type SignSshPublicKeyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::OsLogin::V1beta::SignSshPublicKeyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def sign_ssh_public_key(ssh_public_key: nil, parent: nil) -> ::Google::Cloud::OsLogin::V1beta::SignSshPublicKeyResponse
Pass arguments to sign_ssh_public_key via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • ssh_public_key (::String) — The SSH public key to sign.
  • parent (::String) — The parent project and zone for the signing request. This is needed to properly ensure per-organization ISS processing and potentially to provide for the possibility of zone-specific certificates used in the signing process.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#update_ssh_public_key

def update_ssh_public_key(request, options = nil) -> ::Google::Cloud::OsLogin::Common::SshPublicKey
def update_ssh_public_key(name: nil, ssh_public_key: nil, update_mask: nil) -> ::Google::Cloud::OsLogin::Common::SshPublicKey

Updates an SSH public key and returns the profile information. This method supports patch semantics.

Overloads
def update_ssh_public_key(request, options = nil) -> ::Google::Cloud::OsLogin::Common::SshPublicKey
Pass arguments to update_ssh_public_key via a request object, either of type UpdateSshPublicKeyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::OsLogin::V1beta::UpdateSshPublicKeyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_ssh_public_key(name: nil, ssh_public_key: nil, update_mask: nil) -> ::Google::Cloud::OsLogin::Common::SshPublicKey
Pass arguments to update_ssh_public_key via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — 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, ::Hash) — Required. The SSH public key and expiration time.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Mask to control which fields get updated. Updates all if not present.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.