airflow.providers.google.cloud.operators.vertex_ai.model_service

This module contains Google Vertex AI operators.

Module Contents

Classes

DeleteModelOperator

Deletes a Model.

ExportModelOperator

Exports a trained, exportable Model to a location specified by the user.

ListModelsOperator

Lists Models in a Location.

UploadModelOperator

Uploads a Model artifact into Vertex AI.

class airflow.providers.google.cloud.operators.vertex_ai.model_service.DeleteModelOperator(*, region, project_id, model_id, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Deletes a Model.

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.

  • model_id (str) -- Required. The name of the Model resource to be deleted.

  • retry (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- Designation of what errors, if any, should be retried.

  • timeout (Optional[float]) -- The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) -- Strings which should be sent along with the request as metadata.

  • gcp_conn_id (str) -- The connection ID to use connecting to Google Cloud.

  • delegate_to (Optional[str]) -- The account to impersonate using domain-wide delegation of authority, if any. For this to work, the service account making the request must have domain-wide delegation enabled.

  • impersonation_chain (Optional[Union[str, Sequence[str]]]) -- 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 = ['region', 'model_id', 'project_id', 'impersonation_chain'][source]
execute(self, context)[source]

This is the main method to 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.vertex_ai.model_service.ExportModelOperator(*, project_id, region, model_id, output_config, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Exports a trained, exportable Model to a location specified by the user.

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.

  • model_id (str) -- Required. The resource name of the Model to export.

  • output_config (Union[google.cloud.aiplatform_v1.types.model_service.ExportModelRequest.OutputConfig, Dict]) -- Required. The desired output location and configuration.

  • retry (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- Designation of what errors, if any, should be retried.

  • timeout (Optional[float]) -- The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) -- Strings which should be sent along with the request as metadata.

  • gcp_conn_id (str) -- The connection ID to use connecting to Google Cloud.

  • delegate_to (Optional[str]) -- The account to impersonate using domain-wide delegation of authority, if any. For this to work, the service account making the request must have domain-wide delegation enabled.

  • impersonation_chain (Optional[Union[str, Sequence[str]]]) -- 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 = ['region', 'model_id', 'project_id', 'impersonation_chain'][source]
execute(self, context)[source]

This is the main method to 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.vertex_ai.model_service.ListModelsOperator(*, region, project_id, filter=None, page_size=None, page_token=None, read_mask=None, order_by=None, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Lists Models in a Location.

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.

  • retry (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- Designation of what errors, if any, should be retried.

  • filter (Optional[str]) -- An expression for filtering the results of the request. For field names both snake_case and camelCase are supported. - model supports = and !=. model represents the Model ID, i.e. the last segment of the Model's [resource name][google.cloud.aiplatform.v1.Model.name]. - display_name supports = and != - labels supports general map functions that is: -- labels.key=value - key:value equality -- `labels.key:* or labels:key - key existence -- A key including a space must be quoted. labels."a key".

  • page_size (Optional[int]) -- The standard list page size.

  • page_token (Optional[str]) -- The standard list page token. Typically obtained via [ListModelsResponse.next_page_token][google.cloud.aiplatform.v1.ListModelsResponse.next_page_token] of the previous [ModelService.ListModels][google.cloud.aiplatform.v1.ModelService.ListModels] call.

  • read_mask (Optional[str]) -- Mask specifying which fields to read.

  • order_by (Optional[str]) -- A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending.

  • timeout (Optional[float]) -- The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) -- Strings which should be sent along with the request as metadata.

  • gcp_conn_id (str) -- The connection ID to use connecting to Google Cloud.

  • delegate_to (Optional[str]) -- The account to impersonate using domain-wide delegation of authority, if any. For this to work, the service account making the request must have domain-wide delegation enabled.

  • impersonation_chain (Optional[Union[str, Sequence[str]]]) -- 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 = ['region', 'project_id', 'impersonation_chain'][source]
execute(self, context)[source]

This is the main method to 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.vertex_ai.model_service.UploadModelOperator(*, project_id, region, model, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Uploads a Model artifact into Vertex AI.

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.

  • model (Union[google.cloud.aiplatform_v1.types.Model, Dict]) -- Required. The Model to create.

  • retry (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- Designation of what errors, if any, should be retried.

  • timeout (Optional[float]) -- The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) -- Strings which should be sent along with the request as metadata.

  • gcp_conn_id (str) -- The connection ID to use connecting to Google Cloud.

  • delegate_to (Optional[str]) -- The account to impersonate using domain-wide delegation of authority, if any. For this to work, the service account making the request must have domain-wide delegation enabled.

  • impersonation_chain (Optional[Union[str, Sequence[str]]]) -- 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 = ['region', 'project_id', 'impersonation_chain'][source]
execute(self, context)[source]

This is the main method to 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?