| :py:mod:`airflow.providers.google.cloud.hooks.vertex_ai.endpoint_service` |
| ========================================================================= |
| |
| .. py:module:: airflow.providers.google.cloud.hooks.vertex_ai.endpoint_service |
| |
| .. autoapi-nested-parse:: |
| |
| This module contains a Google Cloud Vertex AI hook. |
| |
| .. spelling:: |
| |
| undeployed |
| undeploy |
| Undeploys |
| aiplatform |
| FieldMask |
| unassigns |
| |
| |
| |
| Module Contents |
| --------------- |
| |
| Classes |
| ~~~~~~~ |
| |
| .. autoapisummary:: |
| |
| airflow.providers.google.cloud.hooks.vertex_ai.endpoint_service.EndpointServiceHook |
| |
| |
| |
| |
| .. py:class:: EndpointServiceHook(gcp_conn_id = 'google_cloud_default', delegate_to = None, impersonation_chain = None) |
| |
| Bases: :py:obj:`airflow.providers.google.common.hooks.base_google.GoogleBaseHook` |
| |
| Hook for Google Cloud Vertex AI Endpoint Service APIs. |
| |
| .. py:method:: get_endpoint_service_client(self, region = None) |
| |
| Returns EndpointServiceClient. |
| |
| |
| .. py:method:: wait_for_operation(self, operation, timeout = None) |
| |
| Waits for long-lasting operation to complete. |
| |
| |
| .. py:method:: extract_endpoint_id(obj) |
| :staticmethod: |
| |
| Returns unique id of the endpoint. |
| |
| |
| .. py:method:: extract_deployed_model_id(obj) |
| :staticmethod: |
| |
| Returns unique id of the deploy model. |
| |
| |
| .. py:method:: create_endpoint(self, project_id, region, endpoint, endpoint_id = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| 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. |
| |
| |
| .. py:method:: delete_endpoint(self, project_id, region, endpoint, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| 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: Required. The Endpoint 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. |
| |
| |
| .. py:method:: deploy_model(self, project_id, region, endpoint, deployed_model, traffic_split = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| 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: 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. |
| |
| |
| .. py:method:: get_endpoint(self, project_id, region, endpoint, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| 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: Required. The Endpoint 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. |
| |
| |
| .. py:method:: list_endpoints(self, project_id, region, filter = None, page_size = None, page_token = None, read_mask = None, order_by = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| 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. |
| |
| |
| .. py:method:: undeploy_model(self, project_id, region, endpoint, deployed_model_id, traffic_split = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| 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: Required. The name of the Endpoint resource from which to undeploy a Model. |
| :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. |
| |
| |
| .. py:method:: update_endpoint(self, project_id, region, endpoint_id, endpoint, update_mask, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| 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: 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. |
| |
| |
| |