blob: 033538544bf42c8a7a2459dca52d25fe64fa762e [file] [log] [blame]
:py:mod:`airflow.providers.google.cloud.operators.vertex_ai.endpoint_service`
=============================================================================
.. py:module:: airflow.providers.google.cloud.operators.vertex_ai.endpoint_service
.. autoapi-nested-parse::
This module contains Google Vertex AI operators.
.. spelling::
undeployed
undeploy
Undeploys
aiplatform
FieldMask
unassigns
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.google.cloud.operators.vertex_ai.endpoint_service.CreateEndpointOperator
airflow.providers.google.cloud.operators.vertex_ai.endpoint_service.DeleteEndpointOperator
airflow.providers.google.cloud.operators.vertex_ai.endpoint_service.DeployModelOperator
airflow.providers.google.cloud.operators.vertex_ai.endpoint_service.GetEndpointOperator
airflow.providers.google.cloud.operators.vertex_ai.endpoint_service.ListEndpointsOperator
airflow.providers.google.cloud.operators.vertex_ai.endpoint_service.UndeployModelOperator
airflow.providers.google.cloud.operators.vertex_ai.endpoint_service.UpdateEndpointOperator
.. py:class:: CreateEndpointOperator(*, region, project_id, endpoint, endpoint_id = None, retry = DEFAULT, timeout = None, metadata = (), gcp_conn_id = 'google_cloud_default', delegate_to = None, impersonation_chain = None, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
Creates an Endpoint.
:param project_id: Required. The ID of the Google Cloud project that the service belongs to.
:param region: Required. The ID of the Google Cloud region that the service belongs to.
:param endpoint: Required. The Endpoint to create.
:param endpoint_id: The ID of Endpoint. This value should be 1-10 characters, and valid characters
are /[0-9]/. If not provided, Vertex AI will generate a value for this ID.
:param retry: Designation of what errors, if any, should be retried.
:param timeout: The timeout for this request.
:param metadata: Strings which should be sent along with the request as metadata.
:param gcp_conn_id: The connection ID to use connecting to Google Cloud.
:param delegate_to: 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.
:param impersonation_chain: 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).
.. py:attribute:: template_fields
:annotation: = ['region', 'project_id', 'impersonation_chain']
.. py:attribute:: operator_extra_links
.. py:method:: execute(context)
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.
.. py:class:: DeleteEndpointOperator(*, region, project_id, endpoint_id, retry = DEFAULT, timeout = None, metadata = (), gcp_conn_id = 'google_cloud_default', delegate_to = None, impersonation_chain = None, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
Deletes an Endpoint.
:param project_id: Required. The ID of the Google Cloud project that the service belongs to.
:param region: Required. The ID of the Google Cloud region that the service belongs to.
:param endpoint_id: Required. The Endpoint ID to delete.
:param retry: Designation of what errors, if any, should be retried.
:param timeout: The timeout for this request.
:param metadata: Strings which should be sent along with the request as metadata.
:param gcp_conn_id: The connection ID to use connecting to Google Cloud.
:param delegate_to: 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.
:param impersonation_chain: 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).
.. py:attribute:: template_fields
:annotation: = ['region', 'endpoint_id', 'project_id', 'impersonation_chain']
.. py:method:: execute(context)
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.
.. py:class:: DeployModelOperator(*, region, project_id, endpoint_id, deployed_model, traffic_split = None, retry = DEFAULT, timeout = None, metadata = (), gcp_conn_id = 'google_cloud_default', delegate_to = None, impersonation_chain = None, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
Deploys a Model into this Endpoint, creating a DeployedModel within it.
:param project_id: Required. The ID of the Google Cloud project that the service belongs to.
:param region: Required. The ID of the Google Cloud region that the service belongs to.
:param endpoint_id: Required. The name of the Endpoint resource into which to deploy a Model. Format:
``projects/{project}/locations/{location}/endpoints/{endpoint}``
:param deployed_model: Required. The DeployedModel to be created within the Endpoint. Note that
[Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] must be updated for
the DeployedModel to start receiving traffic, either as part of this call, or via
[EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
:param traffic_split: A map from a DeployedModel's ID to the percentage of this Endpoint's traffic
that should be forwarded to that DeployedModel.
If this field is non-empty, then the Endpoint's
[traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be overwritten with it. To
refer to the ID of the just being deployed Model, a "0" should be used, and the actual ID of the
new DeployedModel will be filled in its place by this method. The traffic percentage values must
add up to 100.
If this field is empty, then the Endpoint's
[traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not updated.
:param retry: Designation of what errors, if any, should be retried.
:param timeout: The timeout for this request.
:param metadata: Strings which should be sent along with the request as metadata.
:param gcp_conn_id: The connection ID to use connecting to Google Cloud.
:param delegate_to: 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.
:param impersonation_chain: 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).
.. py:attribute:: template_fields
:annotation: = ['region', 'endpoint_id', 'project_id', 'impersonation_chain']
.. py:attribute:: operator_extra_links
.. py:method:: execute(context)
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.
.. py:class:: GetEndpointOperator(*, region, project_id, endpoint_id, retry = DEFAULT, timeout = None, metadata = (), gcp_conn_id = 'google_cloud_default', delegate_to = None, impersonation_chain = None, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
Gets an Endpoint.
:param project_id: Required. The ID of the Google Cloud project that the service belongs to.
:param region: Required. The ID of the Google Cloud region that the service belongs to.
:param endpoint_id: Required. The Endpoint ID to get.
:param retry: Designation of what errors, if any, should be retried.
:param timeout: The timeout for this request.
:param metadata: Strings which should be sent along with the request as metadata.
:param gcp_conn_id: The connection ID to use connecting to Google Cloud.
:param delegate_to: 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.
:param impersonation_chain: 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).
.. py:attribute:: template_fields
:annotation: = ['region', 'endpoint_id', 'project_id', 'impersonation_chain']
.. py:attribute:: operator_extra_links
.. py:method:: execute(context)
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.
.. py:class:: ListEndpointsOperator(*, 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)
Bases: :py:obj:`airflow.models.BaseOperator`
Lists Endpoints in a Location.
:param project_id: Required. The ID of the Google Cloud project that the service belongs to.
:param region: Required. The ID of the Google Cloud region that the service belongs to.
:param filter: The standard list filter.
Supported fields:
- ``display_name`` supports = and !=.
- ``state`` supports = and !=.
- ``model_display_name`` supports = and !=
Some examples of using the filter are:
- ``state="JOB_STATE_SUCCEEDED" AND display_name="my_job"``
- ``state="JOB_STATE_RUNNING" OR display_name="my_job"``
- ``NOT display_name="my_job"``
- ``state="JOB_STATE_FAILED"``
:param page_size: The standard list page size.
:param page_token: The standard list page token.
:param read_mask: Mask specifying which fields to read.
:param order_by: A comma-separated list of fields to order by, sorted in
ascending order. Use "desc" after a field name for
descending. Supported fields:
- ``display_name``
- ``create_time``
- ``update_time``
Example: ``display_name, create_time desc``.
:param retry: Designation of what errors, if any, should be retried.
:param timeout: The timeout for this request.
:param metadata: Strings which should be sent along with the request as metadata.
:param gcp_conn_id: The connection ID to use connecting to Google Cloud.
:param delegate_to: 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.
:param impersonation_chain: 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).
.. py:attribute:: template_fields
:annotation: = ['region', 'project_id', 'impersonation_chain']
.. py:attribute:: operator_extra_links
.. py:method:: execute(context)
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.
.. py:class:: UndeployModelOperator(*, region, project_id, endpoint_id, deployed_model_id, traffic_split = None, retry = DEFAULT, timeout = None, metadata = (), gcp_conn_id = 'google_cloud_default', delegate_to = None, impersonation_chain = None, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
Undeploys a Model from an Endpoint, removing a DeployedModel from it, and freeing all resources it's
using.
:param project_id: Required. The ID of the Google Cloud project that the service belongs to.
:param region: Required. The ID of the Google Cloud region that the service belongs to.
:param endpoint_id: Required. The name of the Endpoint resource from which to undeploy a Model. Format:
``projects/{project}/locations/{location}/endpoints/{endpoint}``
:param deployed_model_id: Required. The ID of the DeployedModel to be undeployed from the Endpoint.
:param traffic_split: If this field is provided, then the Endpoint's
[traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be overwritten with it. If
last DeployedModel is being undeployed from the Endpoint, the [Endpoint.traffic_split] will always
end up empty when this call returns. A DeployedModel will be successfully undeployed only if it
doesn't have any traffic assigned to it when this method executes, or if this field unassigns any
traffic to it.
:param retry: Designation of what errors, if any, should be retried.
:param timeout: The timeout for this request.
:param metadata: Strings which should be sent along with the request as metadata.
:param gcp_conn_id: The connection ID to use connecting to Google Cloud.
:param delegate_to: 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.
:param impersonation_chain: 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).
.. py:attribute:: template_fields
:annotation: = ['region', 'endpoint_id', 'deployed_model_id', 'project_id', 'impersonation_chain']
.. py:method:: execute(context)
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.
.. py:class:: UpdateEndpointOperator(*, project_id, region, endpoint_id, endpoint, update_mask, retry = DEFAULT, timeout = None, metadata = (), gcp_conn_id = 'google_cloud_default', delegate_to = None, impersonation_chain = None, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
Updates an Endpoint.
:param project_id: Required. The ID of the Google Cloud project that the service belongs to.
:param region: Required. The ID of the Google Cloud region that the service belongs to.
:param endpoint_id: Required. The ID of the Endpoint to update.
:param endpoint: Required. The Endpoint which replaces the resource on the server.
:param update_mask: Required. The update mask applies to the resource. See
[google.protobuf.FieldMask][google.protobuf.FieldMask].
:param retry: Designation of what errors, if any, should be retried.
:param timeout: The timeout for this request.
:param metadata: Strings which should be sent along with the request as metadata.
:param gcp_conn_id: The connection ID to use connecting to Google Cloud.
:param delegate_to: 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.
:param impersonation_chain: 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).
.. py:attribute:: template_fields
:annotation: = ['region', 'endpoint_id', 'project_id', 'impersonation_chain']
.. py:attribute:: operator_extra_links
.. py:method:: execute(context)
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.