airflow.providers.google.cloud.hooks.os_login

Module Contents

Classes

OSLoginHook

Hook for Google OS login APIs.

class airflow.providers.google.cloud.hooks.os_login.OSLoginHook(gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None)[source]

Bases: airflow.providers.google.common.hooks.base_google.GoogleBaseHook

Hook for Google OS login APIs.

All the methods in the hook where project_id is used must be called with keyword arguments rather than positional.

get_conn(self)[source]

Return OS Login service client

import_ssh_public_key(self, user, ssh_public_key, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[source]

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
  • user (str) – The unique ID for the user

  • ssh_public_key (Dict) – The SSH public key and expiration time.

  • project_id (str) – The project ID of the Google Cloud project.

  • retry (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) – A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

  • timeout (Optional[float]) – The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (Sequence[Tuple[str, str]]) – Additional metadata that is provided to the method.

Returns

A ImportSshPublicKeyResponse instance.

Return type

google.cloud.oslogin_v1.ImportSshPublicKeyResponse

Was this entry helpful?