| :py:mod:`airflow.providers.google.cloud.hooks.vertex_ai.model_service` |
| ====================================================================== |
| |
| .. py:module:: airflow.providers.google.cloud.hooks.vertex_ai.model_service |
| |
| .. autoapi-nested-parse:: |
| |
| This module contains a Google Cloud Vertex AI hook. |
| |
| .. spelling:: |
| |
| aiplatform |
| camelCase |
| |
| |
| |
| Module Contents |
| --------------- |
| |
| Classes |
| ~~~~~~~ |
| |
| .. autoapisummary:: |
| |
| airflow.providers.google.cloud.hooks.vertex_ai.model_service.ModelServiceHook |
| |
| |
| |
| |
| .. py:class:: ModelServiceHook(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_model_service_client(self, region = None) |
| |
| Returns ModelServiceClient. |
| |
| |
| .. py:method:: extract_model_id(obj) |
| :staticmethod: |
| |
| Returns unique id of the model. |
| |
| |
| .. py:method:: wait_for_operation(self, operation, timeout = None) |
| |
| Waits for long-lasting operation to complete. |
| |
| |
| .. py:method:: delete_model(self, project_id, region, model, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Deletes a Model. |
| |
| :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 model: Required. The name of the Model resource to be deleted. |
| :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:: export_model(self, project_id, region, model, output_config, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Exports a trained, exportable Model to a location specified by the user. |
| |
| :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 model: Required. The resource name of the Model to export. |
| :param output_config: Required. The desired output location and configuration. |
| :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_models(self, project_id, region, filter = None, page_size = None, page_token = None, read_mask = None, order_by = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Lists Models 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: 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"``. |
| :param page_size: The standard list page size. |
| :param page_token: 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. |
| :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. |
| :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:: upload_model(self, project_id, region, model, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Uploads a Model artifact into Vertex AI. |
| |
| :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 model: Required. The Model to create. |
| :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. |
| |
| |
| |