airflow.providers.google.cloud.operators.cloud_run

Module Contents

Classes

CloudRunCreateJobOperator

Creates a job without executing it. Pushes the created job to xcom.

CloudRunUpdateJobOperator

Updates a job and wait for the operation to be completed. Pushes the updated job to xcom.

CloudRunDeleteJobOperator

Deletes a job and wait for the the operation to be completed. Pushes the deleted job to xcom.

CloudRunListJobsOperator

Lists jobs.

CloudRunExecuteJobOperator

Executes a job and waits for the operation to be completed. Pushes the executed job to xcom.

CloudRunCreateServiceOperator

Creates a Service without executing it. Pushes the created service to xcom.

CloudRunDeleteServiceOperator

Deletes a Service without executing it. Pushes the deleted service to xcom.

class airflow.providers.google.cloud.operators.cloud_run.CloudRunCreateJobOperator(project_id, region, job_name, job, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Creates a job without executing it. Pushes the created job to xcom.

Parameters
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • region (str) – Required. The ID of the Google Cloud region that the service belongs to.

  • job_name (str) – Required. The name of the job to create.

  • job (dict | google.cloud.run_v2.Job) – Required. The job descriptor containing the configuration of the job to submit.

  • gcp_conn_id (str) – The connection ID used to connect to Google Cloud.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields = ('project_id', 'region', 'gcp_conn_id', 'impersonation_chain', 'job_name')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_run.CloudRunUpdateJobOperator(project_id, region, job_name, job, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Updates a job and wait for the operation to be completed. Pushes the updated job to xcom.

Parameters
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • region (str) – Required. The ID of the Google Cloud region that the service belongs to.

  • job_name (str) – Required. The name of the job to update.

  • job (dict | google.cloud.run_v2.Job) – Required. The job descriptor containing the new configuration of the job to update. The name field will be replaced by job_name

  • gcp_conn_id (str) – The connection ID used to connect to Google Cloud.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields = ('project_id', 'region', 'gcp_conn_id', 'impersonation_chain', 'job_name')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_run.CloudRunDeleteJobOperator(project_id, region, job_name, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Deletes a job and wait for the the operation to be completed. Pushes the deleted job to xcom.

Parameters
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • region (str) – Required. The ID of the Google Cloud region that the service belongs to.

  • job_name (str) – Required. The name of the job to delete.

  • gcp_conn_id (str) – The connection ID used to connect to Google Cloud.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields = ('project_id', 'region', 'gcp_conn_id', 'impersonation_chain', 'job_name')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_run.CloudRunListJobsOperator(project_id, region, show_deleted=False, limit=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Lists jobs.

Parameters
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • region (str) – Required. The ID of the Google Cloud region that the service belongs to.

  • show_deleted (bool) – If true, returns deleted (but unexpired) resources along with active ones.

  • limit (int | None) – The number of jobs to list. If left empty, all the jobs will be returned.

  • gcp_conn_id (str) – The connection ID used to connect to Google Cloud.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields = ('project_id', 'region', 'gcp_conn_id', 'impersonation_chain')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_run.CloudRunExecuteJobOperator(project_id, region, job_name, overrides=None, polling_period_seconds=10, timeout_seconds=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Executes a job and waits for the operation to be completed. Pushes the executed job to xcom.

Parameters
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • region (str) – Required. The ID of the Google Cloud region that the service belongs to.

  • job_name (str) – Required. The name of the job to update.

  • overrides (dict[str, Any] | None) – Optional map of override values.

  • gcp_conn_id (str) – The connection ID used to connect to Google Cloud.

  • polling_period_seconds (float) – Optional. Control the rate of the poll for the result of deferrable run. By default, the trigger will poll every 10 seconds.

  • timeout_seconds (float | None) – Optional. The timeout for this request, in seconds.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

  • deferrable (bool) – Run the operator in deferrable mode.

template_fields = ('project_id', 'region', 'gcp_conn_id', 'impersonation_chain', 'job_name', 'overrides')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

execute_complete(context, event)[source]
class airflow.providers.google.cloud.operators.cloud_run.CloudRunCreateServiceOperator(project_id, region, service_name, service, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Creates a Service without executing it. Pushes the created service to xcom.

Parameters
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • region (str) – Required. The ID of the Google Cloud region that the service belongs to.

  • service_name (str) – Required. The name of the service to create.

  • service (dict | google.cloud.run_v2.Service) – The service descriptor containing the configuration of the service to submit.

  • gcp_conn_id (str) – The connection ID used to connect to Google Cloud.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields = ('project_id', 'region', 'gcp_conn_id', 'impersonation_chain', 'service_name')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_run.CloudRunDeleteServiceOperator(project_id, region, service_name, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

Deletes a Service without executing it. Pushes the deleted service to xcom.

Parameters
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • region (str) – Required. The ID of the Google Cloud region that the service belongs to.

  • service_name (str) – Required. The name of the service to create.

  • gcp_conn_id (str) – The connection ID used to connect to Google Cloud.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields = ('project_id', 'region', 'gcp_conn_id', 'impersonation_chain', 'service_name')[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?