From 33b209bdbaca4a956c7375fd65cbf8d6c3b4d95d Mon Sep 17 00:00:00 2001 From: Miles Yucht Date: Fri, 15 Mar 2024 12:06:02 +0100 Subject: [PATCH] Release v0.22.0 (#584) * Fix typos in doc string for select_spark_version ([#575](https://github.com/databricks/databricks-sdk-py/pull/575)). API Changes: * Changed `notifications` field for `databricks.sdk.service.catalog.CreateMonitor`, `databricks.sdk.service.catalog.MonitorInfo`, and `databricks.sdk.service.catalog.UpdateMonitor` to `databricks.sdk.service.catalog.MonitorNotificationsConfig` dataclass. * Added `browse_only` field for `databricks.sdk.service.catalog.ExternalLocationInfo`, `databricks.sdk.service.catalog.FunctionInfo`, `databricks.sdk.service.catalog.ModelVersionInfo`, `databricks.sdk.service.catalog.RegisteredModelInfo`, `databricks.sdk.service.catalog.SchemaInfo`, `databricks.sdk.service.catalog.TableInfo`, and `databricks.sdk.service.catalog.VolumeInfo`. * Added `include_browse` field for `databricks.sdk.service.catalog.GetCatalogRequest`, `databricks.sdk.service.catalog.GetExternalLocationRequest`, `databricks.sdk.service.catalog.GetFunctionRequest`, `databricks.sdk.service.catalog.GetModelVersionRequest`, `databricks.sdk.service.catalog.GetRegisteredModelRequest`, `databricks.sdk.service.catalog.GetSchemaRequest`, `databricks.sdk.service.catalog.GetTableRequest`, `databricks.sdk.service.catalog.ListExternalLocationsRequest`, `databricks.sdk.service.catalog.ListFunctionsRequest`, `databricks.sdk.service.catalog.ListModelVersionsRequest`, `databricks.sdk.service.catalog.ListRegisteredModelsRequest`, `databricks.sdk.service.catalog.ListSchemasRequest`, `databricks.sdk.service.catalog.ListTablesRequest`, `databricks.sdk.service.catalog.ListVolumesRequest`, and `databricks.sdk.service.catalog.ReadVolumeRequest`. * Changed `publish()` method for [w.lakeview](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/lakeview.html) workspace-level service to return `databricks.sdk.service.dashboards.PublishedDashboard` dataclass. * Added `create()`, `get()`, `get_published()`, `trash()`, and `update()` methods for [w.lakeview](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/lakeview.html) workspace-level service. * Added `databricks.sdk.service.dashboards.CreateDashboardRequest`, `databricks.sdk.service.dashboards.Dashboard`, `databricks.sdk.service.dashboards.GetLakeviewRequest`, `databricks.sdk.service.dashboards.GetPublishedRequest`, `databricks.sdk.service.dashboards.LifecycleState`, `databricks.sdk.service.dashboards.PublishedDashboard`, `databricks.sdk.service.dashboards.TrashRequest`, and `databricks.sdk.service.dashboards.UpdateDashboardRequest` dataclasses. OpenAPI SHA: c84caf9e5ef531cc0b1ddd0a76970d9a8b664e32, Date: 2024-03-15 --- .codegen/_openapi_sha | 2 +- CHANGELOG.md | 15 + databricks/sdk/service/catalog.py | 282 +++++++++++----- databricks/sdk/service/dashboards.py | 314 +++++++++++++++++- databricks/sdk/service/iam.py | 1 + databricks/sdk/service/serving.py | 25 +- databricks/sdk/service/settings.py | 8 +- databricks/sdk/service/sql.py | 6 +- databricks/sdk/version.py | 2 +- .../account/settings/network_connectivity.rst | 8 +- docs/dbdataclasses/catalog.rst | 8 +- docs/dbdataclasses/dashboards.rst | 26 +- docs/dbdataclasses/iam.rst | 3 + docs/workspace/catalog/catalogs.rst | 11 +- docs/workspace/catalog/external_locations.rst | 13 +- docs/workspace/catalog/functions.rst | 15 +- docs/workspace/catalog/lakehouse_monitors.rst | 8 +- docs/workspace/catalog/model_versions.rst | 10 +- docs/workspace/catalog/registered_models.rst | 10 +- docs/workspace/catalog/schemas.rst | 15 +- .../workspace/catalog/storage_credentials.rst | 5 +- docs/workspace/catalog/tables.rst | 10 +- docs/workspace/catalog/volumes.rst | 10 +- docs/workspace/compute/clusters.rst | 4 +- docs/workspace/dashboards/lakeview.rst | 78 ++++- docs/workspace/serving/serving_endpoints.rst | 21 +- 26 files changed, 749 insertions(+), 161 deletions(-) diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index d690f709..3a6253c8 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -1026b998b14fba1b8317528f47778240dc4e9a5d \ No newline at end of file +c84caf9e5ef531cc0b1ddd0a76970d9a8b664e32 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 96419f9e..b9919039 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Version changelog +## 0.22.0 + +* Fix typos in doc string for select_spark_version ([#575](https://github.com/databricks/databricks-sdk-py/pull/575)). + +API Changes: + + * Changed `notifications` field for `databricks.sdk.service.catalog.CreateMonitor`, `databricks.sdk.service.catalog.MonitorInfo`, and `databricks.sdk.service.catalog.UpdateMonitor` to `databricks.sdk.service.catalog.MonitorNotificationsConfig` dataclass. + * Added `browse_only` field for `databricks.sdk.service.catalog.ExternalLocationInfo`, `databricks.sdk.service.catalog.FunctionInfo`, `databricks.sdk.service.catalog.ModelVersionInfo`, `databricks.sdk.service.catalog.RegisteredModelInfo`, `databricks.sdk.service.catalog.SchemaInfo`, `databricks.sdk.service.catalog.TableInfo`, and `databricks.sdk.service.catalog.VolumeInfo`. + * Added `include_browse` field for `databricks.sdk.service.catalog.GetCatalogRequest`, `databricks.sdk.service.catalog.GetExternalLocationRequest`, `databricks.sdk.service.catalog.GetFunctionRequest`, `databricks.sdk.service.catalog.GetModelVersionRequest`, `databricks.sdk.service.catalog.GetRegisteredModelRequest`, `databricks.sdk.service.catalog.GetSchemaRequest`, `databricks.sdk.service.catalog.GetTableRequest`, `databricks.sdk.service.catalog.ListExternalLocationsRequest`, `databricks.sdk.service.catalog.ListFunctionsRequest`, `databricks.sdk.service.catalog.ListModelVersionsRequest`, `databricks.sdk.service.catalog.ListRegisteredModelsRequest`, `databricks.sdk.service.catalog.ListSchemasRequest`, `databricks.sdk.service.catalog.ListTablesRequest`, `databricks.sdk.service.catalog.ListVolumesRequest`, and `databricks.sdk.service.catalog.ReadVolumeRequest`. + * Changed `publish()` method for [w.lakeview](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/lakeview.html) workspace-level service to return `databricks.sdk.service.dashboards.PublishedDashboard` dataclass. + * Added `create()`, `get()`, `get_published()`, `trash()`, and `update()` methods for [w.lakeview](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/lakeview.html) workspace-level service. + * Added `databricks.sdk.service.dashboards.CreateDashboardRequest`, `databricks.sdk.service.dashboards.Dashboard`, `databricks.sdk.service.dashboards.GetLakeviewRequest`, `databricks.sdk.service.dashboards.GetPublishedRequest`, `databricks.sdk.service.dashboards.LifecycleState`, `databricks.sdk.service.dashboards.PublishedDashboard`, `databricks.sdk.service.dashboards.TrashRequest`, and `databricks.sdk.service.dashboards.UpdateDashboardRequest` dataclasses. + +OpenAPI SHA: c84caf9e5ef531cc0b1ddd0a76970d9a8b664e32, Date: 2024-03-15 + ## 0.21.0 ### New Features and Improvements diff --git a/databricks/sdk/service/catalog.py b/databricks/sdk/service/catalog.py index d5e865ab..f85ba64a 100755 --- a/databricks/sdk/service/catalog.py +++ b/databricks/sdk/service/catalog.py @@ -378,7 +378,8 @@ def from_dict(cls, d: Dict[str, any]) -> CancelRefreshResponse: @dataclass class CatalogInfo: browse_only: Optional[bool] = None - """Indicate whether or not the catalog info contains only browsable metadata.""" + """Indicates whether the principal is limited to retrieving metadata for the associated object + through the BROWSE privilege when include_browse is enabled in the request.""" catalog_type: Optional[CatalogType] = None """The type of the catalog.""" @@ -1252,7 +1253,7 @@ class CreateMonitor: inference_log: Optional[MonitorInferenceLogProfileType] = None """Configuration for monitoring inference logs.""" - notifications: Optional[List[MonitorNotificationsConfig]] = None + notifications: Optional[MonitorNotificationsConfig] = None """The notification settings for the monitor.""" schedule: Optional[MonitorCronSchedule] = None @@ -1286,7 +1287,7 @@ def as_dict(self) -> dict: body['data_classification_config'] = self.data_classification_config.as_dict() if self.full_name is not None: body['full_name'] = self.full_name if self.inference_log: body['inference_log'] = self.inference_log.as_dict() - if self.notifications: body['notifications'] = [v.as_dict() for v in self.notifications] + if self.notifications: body['notifications'] = self.notifications.as_dict() if self.output_schema_name is not None: body['output_schema_name'] = self.output_schema_name if self.schedule: body['schedule'] = self.schedule.as_dict() if self.skip_builtin_dashboard is not None: @@ -1307,7 +1308,7 @@ def from_dict(cls, d: Dict[str, any]) -> CreateMonitor: MonitorDataClassificationConfig), full_name=d.get('full_name', None), inference_log=_from_dict(d, 'inference_log', MonitorInferenceLogProfileType), - notifications=_repeated_dict(d, 'notifications', MonitorNotificationsConfig), + notifications=_from_dict(d, 'notifications', MonitorNotificationsConfig), output_schema_name=d.get('output_schema_name', None), schedule=_from_dict(d, 'schedule', MonitorCronSchedule), skip_builtin_dashboard=d.get('skip_builtin_dashboard', None), @@ -1317,6 +1318,29 @@ def from_dict(cls, d: Dict[str, any]) -> CreateMonitor: warehouse_id=d.get('warehouse_id', None)) +@dataclass +class CreateOnlineTableRequest: + """Online Table information.""" + + name: Optional[str] = None + """Full three-part (catalog, schema, table) name of the table.""" + + spec: Optional[OnlineTableSpec] = None + """Specification of the online table.""" + + def as_dict(self) -> dict: + """Serializes the CreateOnlineTableRequest into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.name is not None: body['name'] = self.name + if self.spec: body['spec'] = self.spec.as_dict() + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> CreateOnlineTableRequest: + """Deserializes the CreateOnlineTableRequest from a dictionary.""" + return cls(name=d.get('name', None), spec=_from_dict(d, 'spec', OnlineTableSpec)) + + @dataclass class CreateRegisteredModelRequest: catalog_name: str @@ -1879,6 +1903,10 @@ class ExternalLocationInfo: access_point: Optional[str] = None """The AWS access point to use when accesing s3 for this external location.""" + browse_only: Optional[bool] = None + """Indicates whether the principal is limited to retrieving metadata for the associated object + through the BROWSE privilege when include_browse is enabled in the request.""" + comment: Optional[str] = None """User-provided free-form text description.""" @@ -1922,6 +1950,7 @@ def as_dict(self) -> dict: """Serializes the ExternalLocationInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: body['access_point'] = self.access_point + if self.browse_only is not None: body['browse_only'] = self.browse_only if self.comment is not None: body['comment'] = self.comment if self.created_at is not None: body['created_at'] = self.created_at if self.created_by is not None: body['created_by'] = self.created_by @@ -1941,6 +1970,7 @@ def as_dict(self) -> dict: def from_dict(cls, d: Dict[str, any]) -> ExternalLocationInfo: """Deserializes the ExternalLocationInfo from a dictionary.""" return cls(access_point=d.get('access_point', None), + browse_only=d.get('browse_only', None), comment=d.get('comment', None), created_at=d.get('created_at', None), created_by=d.get('created_by', None), @@ -2039,6 +2069,10 @@ def from_dict(cls, d: Dict[str, any]) -> FunctionDependency: @dataclass class FunctionInfo: + browse_only: Optional[bool] = None + """Indicates whether the principal is limited to retrieving metadata for the associated object + through the BROWSE privilege when include_browse is enabled in the request.""" + catalog_name: Optional[str] = None """Name of parent catalog.""" @@ -2131,6 +2165,7 @@ class FunctionInfo: def as_dict(self) -> dict: """Serializes the FunctionInfo into a dictionary suitable for use as a JSON request body.""" body = {} + if self.browse_only is not None: body['browse_only'] = self.browse_only if self.catalog_name is not None: body['catalog_name'] = self.catalog_name if self.comment is not None: body['comment'] = self.comment if self.created_at is not None: body['created_at'] = self.created_at @@ -2165,7 +2200,8 @@ def as_dict(self) -> dict: @classmethod def from_dict(cls, d: Dict[str, any]) -> FunctionInfo: """Deserializes the FunctionInfo from a dictionary.""" - return cls(catalog_name=d.get('catalog_name', None), + return cls(browse_only=d.get('browse_only', None), + catalog_name=d.get('catalog_name', None), comment=d.get('comment', None), created_at=d.get('created_at', None), created_by=d.get('created_by', None), @@ -2899,6 +2935,10 @@ class MetastoreInfoDeltaSharingScope(Enum): @dataclass class ModelVersionInfo: + browse_only: Optional[bool] = None + """Indicates whether the principal is limited to retrieving metadata for the associated object + through the BROWSE privilege when include_browse is enabled in the request.""" + catalog_name: Optional[str] = None """The name of the catalog containing the model version""" @@ -2955,6 +2995,7 @@ class ModelVersionInfo: def as_dict(self) -> dict: """Serializes the ModelVersionInfo into a dictionary suitable for use as a JSON request body.""" body = {} + if self.browse_only is not None: body['browse_only'] = self.browse_only if self.catalog_name is not None: body['catalog_name'] = self.catalog_name if self.comment is not None: body['comment'] = self.comment if self.created_at is not None: body['created_at'] = self.created_at @@ -2978,7 +3019,8 @@ def as_dict(self) -> dict: @classmethod def from_dict(cls, d: Dict[str, any]) -> ModelVersionInfo: """Deserializes the ModelVersionInfo from a dictionary.""" - return cls(catalog_name=d.get('catalog_name', None), + return cls(browse_only=d.get('browse_only', None), + catalog_name=d.get('catalog_name', None), comment=d.get('comment', None), created_at=d.get('created_at', None), created_by=d.get('created_by', None), @@ -3112,7 +3154,8 @@ def from_dict(cls, d: Dict[str, any]) -> MonitorDataClassificationConfig: @dataclass class MonitorDestinations: email_addresses: Optional[List[str]] = None - """The list of email addresses to send the notification to.""" + """The list of email addresses to send the notification to. A maximum of 5 email addresses is + supported.""" def as_dict(self) -> dict: """Serializes the MonitorDestinations into a dictionary suitable for use as a JSON request body.""" @@ -3213,7 +3256,7 @@ class MonitorInfo: monitor_version: Optional[str] = None """The version of the monitor config (e.g. 1,2,3). If negative, the monitor may be corrupted.""" - notifications: Optional[List[MonitorNotificationsConfig]] = None + notifications: Optional[MonitorNotificationsConfig] = None """The notification settings for the monitor.""" output_schema_name: Optional[str] = None @@ -3258,7 +3301,7 @@ def as_dict(self) -> dict: if self.latest_monitor_failure_msg is not None: body['latest_monitor_failure_msg'] = self.latest_monitor_failure_msg if self.monitor_version is not None: body['monitor_version'] = self.monitor_version - if self.notifications: body['notifications'] = [v.as_dict() for v in self.notifications] + if self.notifications: body['notifications'] = self.notifications.as_dict() if self.output_schema_name is not None: body['output_schema_name'] = self.output_schema_name if self.profile_metrics_table_name is not None: body['profile_metrics_table_name'] = self.profile_metrics_table_name @@ -3283,7 +3326,7 @@ def from_dict(cls, d: Dict[str, any]) -> MonitorInfo: inference_log=_from_dict(d, 'inference_log', MonitorInferenceLogProfileType), latest_monitor_failure_msg=d.get('latest_monitor_failure_msg', None), monitor_version=d.get('monitor_version', None), - notifications=_repeated_dict(d, 'notifications', MonitorNotificationsConfig), + notifications=_from_dict(d, 'notifications', MonitorNotificationsConfig), output_schema_name=d.get('output_schema_name', None), profile_metrics_table_name=d.get('profile_metrics_table_name', None), schedule=_from_dict(d, 'schedule', MonitorCronSchedule), @@ -3858,6 +3901,10 @@ class RegisteredModelInfo: aliases: Optional[List[RegisteredModelAlias]] = None """List of aliases associated with the registered model""" + browse_only: Optional[bool] = None + """Indicates whether the principal is limited to retrieving metadata for the associated object + through the BROWSE privilege when include_browse is enabled in the request.""" + catalog_name: Optional[str] = None """The name of the catalog where the schema and the registered model reside""" @@ -3898,6 +3945,7 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.aliases: body['aliases'] = [v.as_dict() for v in self.aliases] + if self.browse_only is not None: body['browse_only'] = self.browse_only if self.catalog_name is not None: body['catalog_name'] = self.catalog_name if self.comment is not None: body['comment'] = self.comment if self.created_at is not None: body['created_at'] = self.created_at @@ -3916,6 +3964,7 @@ def as_dict(self) -> dict: def from_dict(cls, d: Dict[str, any]) -> RegisteredModelInfo: """Deserializes the RegisteredModelInfo from a dictionary.""" return cls(aliases=_repeated_dict(d, 'aliases', RegisteredModelAlias), + browse_only=d.get('browse_only', None), catalog_name=d.get('catalog_name', None), comment=d.get('comment', None), created_at=d.get('created_at', None), @@ -3932,6 +3981,10 @@ def from_dict(cls, d: Dict[str, any]) -> RegisteredModelInfo: @dataclass class SchemaInfo: + browse_only: Optional[bool] = None + """Indicates whether the principal is limited to retrieving metadata for the associated object + through the BROWSE privilege when include_browse is enabled in the request.""" + catalog_name: Optional[str] = None """Name of parent catalog.""" @@ -3982,6 +4035,7 @@ class SchemaInfo: def as_dict(self) -> dict: """Serializes the SchemaInfo into a dictionary suitable for use as a JSON request body.""" body = {} + if self.browse_only is not None: body['browse_only'] = self.browse_only if self.catalog_name is not None: body['catalog_name'] = self.catalog_name if self.catalog_type is not None: body['catalog_type'] = self.catalog_type if self.comment is not None: body['comment'] = self.comment @@ -4007,7 +4061,8 @@ def as_dict(self) -> dict: @classmethod def from_dict(cls, d: Dict[str, any]) -> SchemaInfo: """Deserializes the SchemaInfo from a dictionary.""" - return cls(catalog_name=d.get('catalog_name', None), + return cls(browse_only=d.get('browse_only', None), + catalog_name=d.get('catalog_name', None), catalog_type=d.get('catalog_type', None), comment=d.get('comment', None), created_at=d.get('created_at', None), @@ -4328,6 +4383,10 @@ class TableInfo: access_point: Optional[str] = None """The AWS access point to use when accesing s3 for this external location.""" + browse_only: Optional[bool] = None + """Indicates whether the principal is limited to retrieving metadata for the associated object + through the BROWSE privilege when include_browse is enabled in the request.""" + catalog_name: Optional[str] = None """Name of parent catalog.""" @@ -4425,6 +4484,7 @@ def as_dict(self) -> dict: """Serializes the TableInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: body['access_point'] = self.access_point + if self.browse_only is not None: body['browse_only'] = self.browse_only if self.catalog_name is not None: body['catalog_name'] = self.catalog_name if self.columns: body['columns'] = [v.as_dict() for v in self.columns] if self.comment is not None: body['comment'] = self.comment @@ -4468,6 +4528,7 @@ def as_dict(self) -> dict: def from_dict(cls, d: Dict[str, any]) -> TableInfo: """Deserializes the TableInfo from a dictionary.""" return cls(access_point=d.get('access_point', None), + browse_only=d.get('browse_only', None), catalog_name=d.get('catalog_name', None), columns=_repeated_dict(d, 'columns', ColumnInfo), comment=d.get('comment', None), @@ -4929,7 +4990,7 @@ class UpdateMonitor: inference_log: Optional[MonitorInferenceLogProfileType] = None """Configuration for monitoring inference logs.""" - notifications: Optional[List[MonitorNotificationsConfig]] = None + notifications: Optional[MonitorNotificationsConfig] = None """The notification settings for the monitor.""" schedule: Optional[MonitorCronSchedule] = None @@ -4955,7 +5016,7 @@ def as_dict(self) -> dict: body['data_classification_config'] = self.data_classification_config.as_dict() if self.full_name is not None: body['full_name'] = self.full_name if self.inference_log: body['inference_log'] = self.inference_log.as_dict() - if self.notifications: body['notifications'] = [v.as_dict() for v in self.notifications] + if self.notifications: body['notifications'] = self.notifications.as_dict() if self.output_schema_name is not None: body['output_schema_name'] = self.output_schema_name if self.schedule: body['schedule'] = self.schedule.as_dict() if self.slicing_exprs: body['slicing_exprs'] = [v for v in self.slicing_exprs] @@ -4972,7 +5033,7 @@ def from_dict(cls, d: Dict[str, any]) -> UpdateMonitor: MonitorDataClassificationConfig), full_name=d.get('full_name', None), inference_log=_from_dict(d, 'inference_log', MonitorInferenceLogProfileType), - notifications=_repeated_dict(d, 'notifications', MonitorNotificationsConfig), + notifications=_from_dict(d, 'notifications', MonitorNotificationsConfig), output_schema_name=d.get('output_schema_name', None), schedule=_from_dict(d, 'schedule', MonitorCronSchedule), slicing_exprs=d.get('slicing_exprs', None), @@ -5390,34 +5451,15 @@ class ValidationResultResult(Enum): SKIP = 'SKIP' -@dataclass -class ViewData: - """Online Table information.""" - - name: Optional[str] = None - """Full three-part (catalog, schema, table) name of the table.""" - - spec: Optional[OnlineTableSpec] = None - """Specification of the online table.""" - - def as_dict(self) -> dict: - """Serializes the ViewData into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.name is not None: body['name'] = self.name - if self.spec: body['spec'] = self.spec.as_dict() - return body - - @classmethod - def from_dict(cls, d: Dict[str, any]) -> ViewData: - """Deserializes the ViewData from a dictionary.""" - return cls(name=d.get('name', None), spec=_from_dict(d, 'spec', OnlineTableSpec)) - - @dataclass class VolumeInfo: access_point: Optional[str] = None """The AWS access point to use when accesing s3 for this external location.""" + browse_only: Optional[bool] = None + """Indicates whether the principal is limited to retrieving metadata for the associated object + through the BROWSE privilege when include_browse is enabled in the request.""" + catalog_name: Optional[str] = None """The name of the catalog where the schema and the volume are""" @@ -5464,6 +5506,7 @@ def as_dict(self) -> dict: """Serializes the VolumeInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: body['access_point'] = self.access_point + if self.browse_only is not None: body['browse_only'] = self.browse_only if self.catalog_name is not None: body['catalog_name'] = self.catalog_name if self.comment is not None: body['comment'] = self.comment if self.created_at is not None: body['created_at'] = self.created_at @@ -5485,6 +5528,7 @@ def as_dict(self) -> dict: def from_dict(cls, d: Dict[str, any]) -> VolumeInfo: """Deserializes the VolumeInfo from a dictionary.""" return cls(access_point=d.get('access_point', None), + browse_only=d.get('browse_only', None), catalog_name=d.get('catalog_name', None), comment=d.get('comment', None), created_at=d.get('created_at', None), @@ -6046,7 +6090,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): self._api.do('DELETE', f'/api/2.1/unity-catalog/catalogs/{name}', query=query, headers=headers) - def get(self, name: str) -> CatalogInfo: + def get(self, name: str, *, include_browse: Optional[bool] = None) -> CatalogInfo: """Get a catalog. Gets the specified catalog in a metastore. The caller must be a metastore admin, the owner of the @@ -6054,16 +6098,21 @@ def get(self, name: str) -> CatalogInfo: :param name: str The name of the catalog. + :param include_browse: bool (optional) + Whether to include catalogs in the response for which the principal can only access selective + metadata for :returns: :class:`CatalogInfo` """ + query = {} + if include_browse is not None: query['include_browse'] = include_browse headers = {'Accept': 'application/json', } - res = self._api.do('GET', f'/api/2.1/unity-catalog/catalogs/{name}', headers=headers) + res = self._api.do('GET', f'/api/2.1/unity-catalog/catalogs/{name}', query=query, headers=headers) return CatalogInfo.from_dict(res) - def list(self) -> Iterator[CatalogInfo]: + def list(self, *, include_browse: Optional[bool] = None) -> Iterator[CatalogInfo]: """List catalogs. Gets an array of catalogs in the metastore. If the caller is the metastore admin, all catalogs will be @@ -6071,12 +6120,18 @@ def list(self) -> Iterator[CatalogInfo]: **USE_CATALOG** privilege) will be retrieved. There is no guarantee of a specific ordering of the elements in the array. + :param include_browse: bool (optional) + Whether to include catalogs in the response for which the principal can only access selective + metadata for + :returns: Iterator over :class:`CatalogInfo` """ + query = {} + if include_browse is not None: query['include_browse'] = include_browse headers = {'Accept': 'application/json', } - json = self._api.do('GET', '/api/2.1/unity-catalog/catalogs', headers=headers) + json = self._api.do('GET', '/api/2.1/unity-catalog/catalogs', query=query, headers=headers) parsed = ListCatalogsResponse.from_dict(json).catalogs return parsed if parsed is not None else [] @@ -6343,7 +6398,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): query=query, headers=headers) - def get(self, name: str) -> ExternalLocationInfo: + def get(self, name: str, *, include_browse: Optional[bool] = None) -> ExternalLocationInfo: """Get an external location. Gets an external location from the metastore. The caller must be either a metastore admin, the owner @@ -6351,26 +6406,37 @@ def get(self, name: str) -> ExternalLocationInfo: :param name: str Name of the external location. + :param include_browse: bool (optional) + Whether to include external locations in the response for which the principal can only access + selective metadata for :returns: :class:`ExternalLocationInfo` """ + query = {} + if include_browse is not None: query['include_browse'] = include_browse headers = {'Accept': 'application/json', } - res = self._api.do('GET', f'/api/2.1/unity-catalog/external-locations/{name}', headers=headers) + res = self._api.do('GET', + f'/api/2.1/unity-catalog/external-locations/{name}', + query=query, + headers=headers) return ExternalLocationInfo.from_dict(res) def list(self, *, + include_browse: Optional[bool] = None, max_results: Optional[int] = None, page_token: Optional[str] = None) -> Iterator[ExternalLocationInfo]: """List external locations. Gets an array of external locations (__ExternalLocationInfo__ objects) from the metastore. The caller must be a metastore admin, the owner of the external location, or a user that has some privilege on - the external location. For unpaginated request, there is no guarantee of a specific ordering of the - elements in the array. For paginated request, elements are ordered by their name. + the external location. There is no guarantee of a specific ordering of the elements in the array. + :param include_browse: bool (optional) + Whether to include external locations in the response for which the principal can only access + selective metadata for :param max_results: int (optional) Maximum number of external locations to return. If not set, all the external locations are returned (not recommended). - when set to a value greater than 0, the page length is the minimum of this @@ -6383,6 +6449,7 @@ def list(self, """ query = {} + if include_browse is not None: query['include_browse'] = include_browse if max_results is not None: query['max_results'] = max_results if page_token is not None: query['page_token'] = page_token headers = {'Accept': 'application/json', } @@ -6518,7 +6585,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): self._api.do('DELETE', f'/api/2.1/unity-catalog/functions/{name}', query=query, headers=headers) - def get(self, name: str) -> FunctionInfo: + def get(self, name: str, *, include_browse: Optional[bool] = None) -> FunctionInfo: """Get a function. Gets a function from within a parent catalog and schema. For the fetch to succeed, the user must @@ -6531,19 +6598,25 @@ def get(self, name: str) -> FunctionInfo: :param name: str The fully-qualified name of the function (of the form __catalog_name__.__schema_name__.__function__name__). + :param include_browse: bool (optional) + Whether to include functions in the response for which the principal can only access selective + metadata for :returns: :class:`FunctionInfo` """ + query = {} + if include_browse is not None: query['include_browse'] = include_browse headers = {'Accept': 'application/json', } - res = self._api.do('GET', f'/api/2.1/unity-catalog/functions/{name}', headers=headers) + res = self._api.do('GET', f'/api/2.1/unity-catalog/functions/{name}', query=query, headers=headers) return FunctionInfo.from_dict(res) def list(self, catalog_name: str, schema_name: str, *, + include_browse: Optional[bool] = None, max_results: Optional[int] = None, page_token: Optional[str] = None) -> Iterator[FunctionInfo]: """List functions. @@ -6551,14 +6624,16 @@ def list(self, List functions within the specified parent catalog and schema. If the user is a metastore admin, all functions are returned in the output list. Otherwise, the user must have the **USE_CATALOG** privilege on the catalog and the **USE_SCHEMA** privilege on the schema, and the output list contains only - functions for which either the user has the **EXECUTE** privilege or the user is the owner. For - unpaginated request, there is no guarantee of a specific ordering of the elements in the array. For - paginated request, elements are ordered by their name. + functions for which either the user has the **EXECUTE** privilege or the user is the owner. There is + no guarantee of a specific ordering of the elements in the array. :param catalog_name: str Name of parent catalog for functions of interest. :param schema_name: str Parent schema of functions. + :param include_browse: bool (optional) + Whether to include functions in the response for which the principal can only access selective + metadata for :param max_results: int (optional) Maximum number of functions to return. If not set, all the functions are returned (not recommended). - when set to a value greater than 0, the page length is the minimum of this value and a server @@ -6572,6 +6647,7 @@ def list(self, query = {} if catalog_name is not None: query['catalog_name'] = catalog_name + if include_browse is not None: query['include_browse'] = include_browse if max_results is not None: query['max_results'] = max_results if page_token is not None: query['page_token'] = page_token if schema_name is not None: query['schema_name'] = schema_name @@ -6760,7 +6836,7 @@ def create(self, custom_metrics: Optional[List[MonitorCustomMetric]] = None, data_classification_config: Optional[MonitorDataClassificationConfig] = None, inference_log: Optional[MonitorInferenceLogProfileType] = None, - notifications: Optional[List[MonitorNotificationsConfig]] = None, + notifications: Optional[MonitorNotificationsConfig] = None, schedule: Optional[MonitorCronSchedule] = None, skip_builtin_dashboard: Optional[bool] = None, slicing_exprs: Optional[List[str]] = None, @@ -6795,7 +6871,7 @@ def create(self, The data classification config for the monitor. :param inference_log: :class:`MonitorInferenceLogProfileType` (optional) Configuration for monitoring inference logs. - :param notifications: List[:class:`MonitorNotificationsConfig`] (optional) + :param notifications: :class:`MonitorNotificationsConfig` (optional) The notification settings for the monitor. :param schedule: :class:`MonitorCronSchedule` (optional) The schedule for automatically updating and refreshing metric tables. @@ -6822,12 +6898,12 @@ def create(self, if data_classification_config is not None: body['data_classification_config'] = data_classification_config.as_dict() if inference_log is not None: body['inference_log'] = inference_log.as_dict() - if notifications is not None: body['notifications'] = [v.as_dict() for v in notifications] + if notifications is not None: body['notifications'] = notifications.as_dict() if output_schema_name is not None: body['output_schema_name'] = output_schema_name if schedule is not None: body['schedule'] = schedule.as_dict() if skip_builtin_dashboard is not None: body['skip_builtin_dashboard'] = skip_builtin_dashboard if slicing_exprs is not None: body['slicing_exprs'] = [v for v in slicing_exprs] - if snapshot is not None: body['snapshot'] = snapshot.as_dict() + if snapshot is not None: body['snapshot'] = snapshot if time_series is not None: body['time_series'] = time_series.as_dict() if warehouse_id is not None: body['warehouse_id'] = warehouse_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } @@ -6974,7 +7050,7 @@ def update(self, custom_metrics: Optional[List[MonitorCustomMetric]] = None, data_classification_config: Optional[MonitorDataClassificationConfig] = None, inference_log: Optional[MonitorInferenceLogProfileType] = None, - notifications: Optional[List[MonitorNotificationsConfig]] = None, + notifications: Optional[MonitorNotificationsConfig] = None, schedule: Optional[MonitorCronSchedule] = None, slicing_exprs: Optional[List[str]] = None, snapshot: Optional[MonitorSnapshotProfileType] = None, @@ -7007,7 +7083,7 @@ def update(self, The data classification config for the monitor. :param inference_log: :class:`MonitorInferenceLogProfileType` (optional) Configuration for monitoring inference logs. - :param notifications: List[:class:`MonitorNotificationsConfig`] (optional) + :param notifications: :class:`MonitorNotificationsConfig` (optional) The notification settings for the monitor. :param schedule: :class:`MonitorCronSchedule` (optional) The schedule for automatically updating and refreshing metric tables. @@ -7028,11 +7104,11 @@ def update(self, if data_classification_config is not None: body['data_classification_config'] = data_classification_config.as_dict() if inference_log is not None: body['inference_log'] = inference_log.as_dict() - if notifications is not None: body['notifications'] = [v.as_dict() for v in notifications] + if notifications is not None: body['notifications'] = notifications.as_dict() if output_schema_name is not None: body['output_schema_name'] = output_schema_name if schedule is not None: body['schedule'] = schedule.as_dict() if slicing_exprs is not None: body['slicing_exprs'] = [v for v in slicing_exprs] - if snapshot is not None: body['snapshot'] = snapshot.as_dict() + if snapshot is not None: body['snapshot'] = snapshot if time_series is not None: body['time_series'] = time_series.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } @@ -7335,7 +7411,11 @@ def delete(self, full_name: str, version: int): f'/api/2.1/unity-catalog/models/{full_name}/versions/{version}', headers=headers) - def get(self, full_name: str, version: int) -> RegisteredModelInfo: + def get(self, + full_name: str, + version: int, + *, + include_browse: Optional[bool] = None) -> RegisteredModelInfo: """Get a Model Version. Get a model version. @@ -7348,14 +7428,20 @@ def get(self, full_name: str, version: int) -> RegisteredModelInfo: The three-level (fully qualified) name of the model version :param version: int The integer version number of the model version + :param include_browse: bool (optional) + Whether to include model versions in the response for which the principal can only access selective + metadata for :returns: :class:`RegisteredModelInfo` """ + query = {} + if include_browse is not None: query['include_browse'] = include_browse headers = {'Accept': 'application/json', } res = self._api.do('GET', f'/api/2.1/unity-catalog/models/{full_name}/versions/{version}', + query=query, headers=headers) return RegisteredModelInfo.from_dict(res) @@ -7386,6 +7472,7 @@ def get_by_alias(self, full_name: str, alias: str) -> ModelVersionInfo: def list(self, full_name: str, *, + include_browse: Optional[bool] = None, max_results: Optional[int] = None, page_token: Optional[str] = None) -> Iterator[ModelVersionInfo]: """List Model Versions. @@ -7403,6 +7490,9 @@ def list(self, :param full_name: str The full three-level name of the registered model under which to list model versions + :param include_browse: bool (optional) + Whether to include model versions in the response for which the principal can only access selective + metadata for :param max_results: int (optional) Maximum number of model versions to return. If not set, the page length is set to a server configured value (100, as of 1/3/2024). - when set to a value greater than 0, the page length is the @@ -7416,6 +7506,7 @@ def list(self, """ query = {} + if include_browse is not None: query['include_browse'] = include_browse if max_results is not None: query['max_results'] = max_results if page_token is not None: query['page_token'] = page_token headers = {'Accept': 'application/json', } @@ -7635,7 +7726,7 @@ def delete_alias(self, full_name: str, alias: str): self._api.do('DELETE', f'/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}', headers=headers) - def get(self, full_name: str) -> RegisteredModelInfo: + def get(self, full_name: str, *, include_browse: Optional[bool] = None) -> RegisteredModelInfo: """Get a Registered Model. Get a registered model. @@ -7646,18 +7737,24 @@ def get(self, full_name: str) -> RegisteredModelInfo: :param full_name: str The three-level (fully qualified) name of the registered model + :param include_browse: bool (optional) + Whether to include registered models in the response for which the principal can only access + selective metadata for :returns: :class:`RegisteredModelInfo` """ + query = {} + if include_browse is not None: query['include_browse'] = include_browse headers = {'Accept': 'application/json', } - res = self._api.do('GET', f'/api/2.1/unity-catalog/models/{full_name}', headers=headers) + res = self._api.do('GET', f'/api/2.1/unity-catalog/models/{full_name}', query=query, headers=headers) return RegisteredModelInfo.from_dict(res) def list(self, *, catalog_name: Optional[str] = None, + include_browse: Optional[bool] = None, max_results: Optional[int] = None, page_token: Optional[str] = None, schema_name: Optional[str] = None) -> Iterator[RegisteredModelInfo]: @@ -7677,6 +7774,9 @@ def list(self, :param catalog_name: str (optional) The identifier of the catalog under which to list registered models. If specified, schema_name must be specified. + :param include_browse: bool (optional) + Whether to include registered models in the response for which the principal can only access + selective metadata for :param max_results: int (optional) Max number of registered models to return. If catalog and schema are unspecified, max_results must be specified. If max_results is unspecified, we return all results, starting from the page specified @@ -7692,6 +7792,7 @@ def list(self, query = {} if catalog_name is not None: query['catalog_name'] = catalog_name + if include_browse is not None: query['include_browse'] = include_browse if max_results is not None: query['max_results'] = max_results if page_token is not None: query['page_token'] = page_token if schema_name is not None: query['schema_name'] = schema_name @@ -7832,7 +7933,7 @@ def delete(self, full_name: str): self._api.do('DELETE', f'/api/2.1/unity-catalog/schemas/{full_name}', headers=headers) - def get(self, full_name: str) -> SchemaInfo: + def get(self, full_name: str, *, include_browse: Optional[bool] = None) -> SchemaInfo: """Get a schema. Gets the specified schema within the metastore. The caller must be a metastore admin, the owner of the @@ -7840,30 +7941,38 @@ def get(self, full_name: str) -> SchemaInfo: :param full_name: str Full name of the schema. + :param include_browse: bool (optional) + Whether to include schemas in the response for which the principal can only access selective + metadata for :returns: :class:`SchemaInfo` """ + query = {} + if include_browse is not None: query['include_browse'] = include_browse headers = {'Accept': 'application/json', } - res = self._api.do('GET', f'/api/2.1/unity-catalog/schemas/{full_name}', headers=headers) + res = self._api.do('GET', f'/api/2.1/unity-catalog/schemas/{full_name}', query=query, headers=headers) return SchemaInfo.from_dict(res) def list(self, catalog_name: str, *, + include_browse: Optional[bool] = None, max_results: Optional[int] = None, page_token: Optional[str] = None) -> Iterator[SchemaInfo]: """List schemas. Gets an array of schemas for a catalog in the metastore. If the caller is the metastore admin or the owner of the parent catalog, all schemas for the catalog will be retrieved. Otherwise, only schemas - owned by the caller (or for which the caller has the **USE_SCHEMA** privilege) will be retrieved. For - unpaginated request, there is no guarantee of a specific ordering of the elements in the array. For - paginated request, elements are ordered by their name. + owned by the caller (or for which the caller has the **USE_SCHEMA** privilege) will be retrieved. + There is no guarantee of a specific ordering of the elements in the array. :param catalog_name: str Parent catalog for schemas of interest. + :param include_browse: bool (optional) + Whether to include schemas in the response for which the principal can only access selective + metadata for :param max_results: int (optional) Maximum number of schemas to return. If not set, all the schemas are returned (not recommended). - when set to a value greater than 0, the page length is the minimum of this value and a server @@ -7877,6 +7986,7 @@ def list(self, query = {} if catalog_name is not None: query['catalog_name'] = catalog_name + if include_browse is not None: query['include_browse'] = include_browse if max_results is not None: query['max_results'] = max_results if page_token is not None: query['page_token'] = page_token headers = {'Accept': 'application/json', } @@ -7993,7 +8103,7 @@ def create(self, if cloudflare_api_token is not None: body['cloudflare_api_token'] = cloudflare_api_token.as_dict() if comment is not None: body['comment'] = comment if databricks_gcp_service_account is not None: - body['databricks_gcp_service_account'] = databricks_gcp_service_account.as_dict() + body['databricks_gcp_service_account'] = databricks_gcp_service_account if name is not None: body['name'] = name if read_only is not None: body['read_only'] = read_only if skip_validation is not None: body['skip_validation'] = skip_validation @@ -8050,9 +8160,8 @@ def list(self, Gets an array of storage credentials (as __StorageCredentialInfo__ objects). The array is limited to only those storage credentials the caller has permission to access. If the caller is a metastore - admin, retrieval of credentials is unrestricted. For unpaginated request, there is no guarantee of a - specific ordering of the elements in the array. For paginated request, elements are ordered by their - name. + admin, retrieval of credentials is unrestricted. There is no guarantee of a specific ordering of the + elements in the array. :param max_results: int (optional) Maximum number of storage credentials to return. If not set, all the storage credentials are @@ -8137,7 +8246,7 @@ def update(self, if cloudflare_api_token is not None: body['cloudflare_api_token'] = cloudflare_api_token.as_dict() if comment is not None: body['comment'] = comment if databricks_gcp_service_account is not None: - body['databricks_gcp_service_account'] = databricks_gcp_service_account.as_dict() + body['databricks_gcp_service_account'] = databricks_gcp_service_account if force is not None: body['force'] = force if new_name is not None: body['new_name'] = new_name if owner is not None: body['owner'] = owner @@ -8203,7 +8312,7 @@ def validate(self, body['azure_service_principal'] = azure_service_principal.as_dict() if cloudflare_api_token is not None: body['cloudflare_api_token'] = cloudflare_api_token.as_dict() if databricks_gcp_service_account is not None: - body['databricks_gcp_service_account'] = databricks_gcp_service_account.as_dict() + body['databricks_gcp_service_account'] = databricks_gcp_service_account if external_location_name is not None: body['external_location_name'] = external_location_name if read_only is not None: body['read_only'] = read_only if storage_credential_name is not None: body['storage_credential_name'] = storage_credential_name @@ -8414,7 +8523,11 @@ def exists(self, full_name: str) -> TableExistsResponse: res = self._api.do('GET', f'/api/2.1/unity-catalog/tables/{full_name}/exists', headers=headers) return TableExistsResponse.from_dict(res) - def get(self, full_name: str, *, include_delta_metadata: Optional[bool] = None) -> TableInfo: + def get(self, + full_name: str, + *, + include_browse: Optional[bool] = None, + include_delta_metadata: Optional[bool] = None) -> TableInfo: """Get a table. Gets a table from the metastore for a specific catalog and schema. The caller must satisfy one of the @@ -8425,6 +8538,9 @@ def get(self, full_name: str, *, include_delta_metadata: Optional[bool] = None) :param full_name: str Full name of the table. + :param include_browse: bool (optional) + Whether to include tables in the response for which the principal can only access selective metadata + for :param include_delta_metadata: bool (optional) Whether delta metadata should be included in the response. @@ -8432,6 +8548,7 @@ def get(self, full_name: str, *, include_delta_metadata: Optional[bool] = None) """ query = {} + if include_browse is not None: query['include_browse'] = include_browse if include_delta_metadata is not None: query['include_delta_metadata'] = include_delta_metadata headers = {'Accept': 'application/json', } @@ -8442,6 +8559,7 @@ def list(self, catalog_name: str, schema_name: str, *, + include_browse: Optional[bool] = None, include_delta_metadata: Optional[bool] = None, max_results: Optional[int] = None, omit_columns: Optional[bool] = None, @@ -8459,6 +8577,9 @@ def list(self, Name of parent catalog for tables of interest. :param schema_name: str Parent schema of tables. + :param include_browse: bool (optional) + Whether to include tables in the response for which the principal can only access selective metadata + for :param include_delta_metadata: bool (optional) Whether delta metadata should be included in the response. :param max_results: int (optional) @@ -8478,6 +8599,7 @@ def list(self, query = {} if catalog_name is not None: query['catalog_name'] = catalog_name + if include_browse is not None: query['include_browse'] = include_browse if include_delta_metadata is not None: query['include_delta_metadata'] = include_delta_metadata if max_results is not None: query['max_results'] = max_results if omit_columns is not None: query['omit_columns'] = omit_columns @@ -8657,6 +8779,7 @@ def list(self, catalog_name: str, schema_name: str, *, + include_browse: Optional[bool] = None, max_results: Optional[int] = None, page_token: Optional[str] = None) -> Iterator[VolumeInfo]: """List Volumes. @@ -8675,6 +8798,9 @@ def list(self, The identifier of the catalog :param schema_name: str The identifier of the schema + :param include_browse: bool (optional) + Whether to include volumes in the response for which the principal can only access selective + metadata for :param max_results: int (optional) Maximum number of volumes to return (page length). @@ -8696,6 +8822,7 @@ def list(self, query = {} if catalog_name is not None: query['catalog_name'] = catalog_name + if include_browse is not None: query['include_browse'] = include_browse if max_results is not None: query['max_results'] = max_results if page_token is not None: query['page_token'] = page_token if schema_name is not None: query['schema_name'] = schema_name @@ -8710,7 +8837,7 @@ def list(self, return query['page_token'] = json['next_page_token'] - def read(self, name: str) -> VolumeInfo: + def read(self, name: str, *, include_browse: Optional[bool] = None) -> VolumeInfo: """Get a Volume. Gets a volume from the metastore for a specific catalog and schema. @@ -8721,13 +8848,18 @@ def read(self, name: str) -> VolumeInfo: :param name: str The three-level (fully qualified) name of the volume + :param include_browse: bool (optional) + Whether to include volumes in the response for which the principal can only access selective + metadata for :returns: :class:`VolumeInfo` """ + query = {} + if include_browse is not None: query['include_browse'] = include_browse headers = {'Accept': 'application/json', } - res = self._api.do('GET', f'/api/2.1/unity-catalog/volumes/{name}', headers=headers) + res = self._api.do('GET', f'/api/2.1/unity-catalog/volumes/{name}', query=query, headers=headers) return VolumeInfo.from_dict(res) def update(self, diff --git a/databricks/sdk/service/dashboards.py b/databricks/sdk/service/dashboards.py index 9b4a6195..1b8a8bd9 100755 --- a/databricks/sdk/service/dashboards.py +++ b/databricks/sdk/service/dashboards.py @@ -4,13 +4,119 @@ import logging from dataclasses import dataclass +from enum import Enum from typing import Dict, Optional +from ._internal import _enum + _LOG = logging.getLogger('databricks.sdk') # all definitions in this file are in alphabetical order +@dataclass +class CreateDashboardRequest: + display_name: str + """The display name of the dashboard.""" + + parent_path: Optional[str] = None + """The workspace path of the folder containing the dashboard. Includes leading slash and no + trailing slash.""" + + serialized_dashboard: Optional[str] = None + """The contents of the dashboard in serialized string form.""" + + warehouse_id: Optional[str] = None + """The warehouse ID used to run the dashboard.""" + + def as_dict(self) -> dict: + """Serializes the CreateDashboardRequest into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.display_name is not None: body['display_name'] = self.display_name + if self.parent_path is not None: body['parent_path'] = self.parent_path + if self.serialized_dashboard is not None: body['serialized_dashboard'] = self.serialized_dashboard + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> CreateDashboardRequest: + """Deserializes the CreateDashboardRequest from a dictionary.""" + return cls(display_name=d.get('display_name', None), + parent_path=d.get('parent_path', None), + serialized_dashboard=d.get('serialized_dashboard', None), + warehouse_id=d.get('warehouse_id', None)) + + +@dataclass +class Dashboard: + create_time: Optional[str] = None + """The timestamp of when the dashboard was created.""" + + dashboard_id: Optional[str] = None + """UUID identifying the dashboard.""" + + display_name: Optional[str] = None + """The display name of the dashboard.""" + + etag: Optional[str] = None + """The etag for the dashboard. Can be optionally provided on updates to ensure that the dashboard + has not been modified since the last read.""" + + lifecycle_state: Optional[LifecycleState] = None + """The state of the dashboard resource. Used for tracking trashed status.""" + + parent_path: Optional[str] = None + """The workspace path of the folder containing the dashboard. Includes leading slash and no + trailing slash.""" + + path: Optional[str] = None + """The workspace path of the dashboard asset, including the file name.""" + + serialized_dashboard: Optional[str] = None + """The contents of the dashboard in serialized string form.""" + + update_time: Optional[str] = None + """The timestamp of when the dashboard was last updated by the user.""" + + warehouse_id: Optional[str] = None + """The warehouse ID used to run the dashboard.""" + + def as_dict(self) -> dict: + """Serializes the Dashboard into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.create_time is not None: body['create_time'] = self.create_time + if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id + if self.display_name is not None: body['display_name'] = self.display_name + if self.etag is not None: body['etag'] = self.etag + if self.lifecycle_state is not None: body['lifecycle_state'] = self.lifecycle_state.value + if self.parent_path is not None: body['parent_path'] = self.parent_path + if self.path is not None: body['path'] = self.path + if self.serialized_dashboard is not None: body['serialized_dashboard'] = self.serialized_dashboard + if self.update_time is not None: body['update_time'] = self.update_time + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> Dashboard: + """Deserializes the Dashboard from a dictionary.""" + return cls(create_time=d.get('create_time', None), + dashboard_id=d.get('dashboard_id', None), + display_name=d.get('display_name', None), + etag=d.get('etag', None), + lifecycle_state=_enum(d, 'lifecycle_state', LifecycleState), + parent_path=d.get('parent_path', None), + path=d.get('path', None), + serialized_dashboard=d.get('serialized_dashboard', None), + update_time=d.get('update_time', None), + warehouse_id=d.get('warehouse_id', None)) + + +class LifecycleState(Enum): + + ACTIVE = 'ACTIVE' + TRASHED = 'TRASHED' + + @dataclass class PublishRequest: dashboard_id: Optional[str] = None @@ -40,19 +146,89 @@ def from_dict(cls, d: Dict[str, any]) -> PublishRequest: @dataclass -class PublishResponse: +class PublishedDashboard: + display_name: Optional[str] = None + """The display name of the published dashboard.""" + + embed_credentials: Optional[bool] = None + """Indicates whether credentials are embedded in the published dashboard.""" + + revision_create_time: Optional[str] = None + """The timestamp of when the published dashboard was last revised.""" + + warehouse_id: Optional[str] = None + """The warehouse ID used to run the published dashboard.""" + + def as_dict(self) -> dict: + """Serializes the PublishedDashboard into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.display_name is not None: body['display_name'] = self.display_name + if self.embed_credentials is not None: body['embed_credentials'] = self.embed_credentials + if self.revision_create_time is not None: body['revision_create_time'] = self.revision_create_time + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> PublishedDashboard: + """Deserializes the PublishedDashboard from a dictionary.""" + return cls(display_name=d.get('display_name', None), + embed_credentials=d.get('embed_credentials', None), + revision_create_time=d.get('revision_create_time', None), + warehouse_id=d.get('warehouse_id', None)) + + +@dataclass +class TrashDashboardResponse: def as_dict(self) -> dict: - """Serializes the PublishResponse into a dictionary suitable for use as a JSON request body.""" + """Serializes the TrashDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} return body @classmethod - def from_dict(cls, d: Dict[str, any]) -> PublishResponse: - """Deserializes the PublishResponse from a dictionary.""" + def from_dict(cls, d: Dict[str, any]) -> TrashDashboardResponse: + """Deserializes the TrashDashboardResponse from a dictionary.""" return cls() +@dataclass +class UpdateDashboardRequest: + dashboard_id: Optional[str] = None + """UUID identifying the dashboard.""" + + display_name: Optional[str] = None + """The display name of the dashboard.""" + + etag: Optional[str] = None + """The etag for the dashboard. Can be optionally provided on updates to ensure that the dashboard + has not been modified since the last read.""" + + serialized_dashboard: Optional[str] = None + """The contents of the dashboard in serialized string form.""" + + warehouse_id: Optional[str] = None + """The warehouse ID used to run the dashboard.""" + + def as_dict(self) -> dict: + """Serializes the UpdateDashboardRequest into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id + if self.display_name is not None: body['display_name'] = self.display_name + if self.etag is not None: body['etag'] = self.etag + if self.serialized_dashboard is not None: body['serialized_dashboard'] = self.serialized_dashboard + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> UpdateDashboardRequest: + """Deserializes the UpdateDashboardRequest from a dictionary.""" + return cls(dashboard_id=d.get('dashboard_id', None), + display_name=d.get('display_name', None), + etag=d.get('etag', None), + serialized_dashboard=d.get('serialized_dashboard', None), + warehouse_id=d.get('warehouse_id', None)) + + class LakeviewAPI: """These APIs provide specific management operations for Lakeview dashboards. Generic resource management can be done with Workspace API (import, export, get-status, list, delete).""" @@ -60,11 +236,75 @@ class LakeviewAPI: def __init__(self, api_client): self._api = api_client + def create(self, + display_name: str, + *, + parent_path: Optional[str] = None, + serialized_dashboard: Optional[str] = None, + warehouse_id: Optional[str] = None) -> Dashboard: + """Create dashboard. + + Create a draft dashboard. + + :param display_name: str + The display name of the dashboard. + :param parent_path: str (optional) + The workspace path of the folder containing the dashboard. Includes leading slash and no trailing + slash. + :param serialized_dashboard: str (optional) + The contents of the dashboard in serialized string form. + :param warehouse_id: str (optional) + The warehouse ID used to run the dashboard. + + :returns: :class:`Dashboard` + """ + body = {} + if display_name is not None: body['display_name'] = display_name + if parent_path is not None: body['parent_path'] = parent_path + if serialized_dashboard is not None: body['serialized_dashboard'] = serialized_dashboard + if warehouse_id is not None: body['warehouse_id'] = warehouse_id + headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + + res = self._api.do('POST', '/api/2.0/lakeview/dashboards', body=body, headers=headers) + return Dashboard.from_dict(res) + + def get(self, dashboard_id: str) -> Dashboard: + """Get dashboard. + + Get a draft dashboard. + + :param dashboard_id: str + UUID identifying the dashboard. + + :returns: :class:`Dashboard` + """ + + headers = {'Accept': 'application/json', } + + res = self._api.do('GET', f'/api/2.0/lakeview/dashboards/{dashboard_id}', headers=headers) + return Dashboard.from_dict(res) + + def get_published(self, dashboard_id: str) -> PublishedDashboard: + """Get published dashboard. + + Get the current published dashboard. + + :param dashboard_id: str + UUID identifying the dashboard to be published. + + :returns: :class:`PublishedDashboard` + """ + + headers = {'Accept': 'application/json', } + + res = self._api.do('GET', f'/api/2.0/lakeview/dashboards/{dashboard_id}/published', headers=headers) + return PublishedDashboard.from_dict(res) + def publish(self, dashboard_id: str, *, embed_credentials: Optional[bool] = None, - warehouse_id: Optional[str] = None): + warehouse_id: Optional[str] = None) -> PublishedDashboard: """Publish dashboard. Publish the current draft dashboard. @@ -77,14 +317,68 @@ def publish(self, :param warehouse_id: str (optional) The ID of the warehouse that can be used to override the warehouse which was set in the draft. - + :returns: :class:`PublishedDashboard` """ body = {} if embed_credentials is not None: body['embed_credentials'] = embed_credentials if warehouse_id is not None: body['warehouse_id'] = warehouse_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } - self._api.do('POST', - f'/api/2.0/lakeview/dashboards/{dashboard_id}/published', - body=body, - headers=headers) + res = self._api.do('POST', + f'/api/2.0/lakeview/dashboards/{dashboard_id}/published', + body=body, + headers=headers) + return PublishedDashboard.from_dict(res) + + def trash(self, dashboard_id: str): + """Trash dashboard. + + Trash a dashboard. + + :param dashboard_id: str + UUID identifying the dashboard. + + + """ + + headers = {'Accept': 'application/json', } + + self._api.do('DELETE', f'/api/2.0/lakeview/dashboards/{dashboard_id}', headers=headers) + + def update(self, + dashboard_id: str, + *, + display_name: Optional[str] = None, + etag: Optional[str] = None, + serialized_dashboard: Optional[str] = None, + warehouse_id: Optional[str] = None) -> Dashboard: + """Update dashboard. + + Update a draft dashboard. + + :param dashboard_id: str + UUID identifying the dashboard. + :param display_name: str (optional) + The display name of the dashboard. + :param etag: str (optional) + The etag for the dashboard. Can be optionally provided on updates to ensure that the dashboard has + not been modified since the last read. + :param serialized_dashboard: str (optional) + The contents of the dashboard in serialized string form. + :param warehouse_id: str (optional) + The warehouse ID used to run the dashboard. + + :returns: :class:`Dashboard` + """ + body = {} + if display_name is not None: body['display_name'] = display_name + if etag is not None: body['etag'] = etag + if serialized_dashboard is not None: body['serialized_dashboard'] = serialized_dashboard + if warehouse_id is not None: body['warehouse_id'] = warehouse_id + headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + + res = self._api.do('PATCH', + f'/api/2.0/lakeview/dashboards/{dashboard_id}', + body=body, + headers=headers) + return Dashboard.from_dict(res) diff --git a/databricks/sdk/service/iam.py b/databricks/sdk/service/iam.py index 4200c633..01fdc4f6 100755 --- a/databricks/sdk/service/iam.py +++ b/databricks/sdk/service/iam.py @@ -777,6 +777,7 @@ class PermissionLevel(Enum): CAN_MANAGE_PRODUCTION_VERSIONS = 'CAN_MANAGE_PRODUCTION_VERSIONS' CAN_MANAGE_RUN = 'CAN_MANAGE_RUN' CAN_MANAGE_STAGING_VERSIONS = 'CAN_MANAGE_STAGING_VERSIONS' + CAN_QUERY = 'CAN_QUERY' CAN_READ = 'CAN_READ' CAN_RESTART = 'CAN_RESTART' CAN_RUN = 'CAN_RUN' diff --git a/databricks/sdk/service/serving.py b/databricks/sdk/service/serving.py index 0011164a..d0eee8b8 100755 --- a/databricks/sdk/service/serving.py +++ b/databricks/sdk/service/serving.py @@ -567,12 +567,12 @@ class EndpointCoreConfigInput: """The name of the serving endpoint to update. This field is required.""" served_entities: Optional[List[ServedEntityInput]] = None - """A list of served entities for the endpoint to serve. A serving endpoint can have up to 10 served + """A list of served entities for the endpoint to serve. A serving endpoint can have up to 15 served entities.""" served_models: Optional[List[ServedModelInput]] = None """(Deprecated, use served_entities instead) A list of served models for the endpoint to serve. A - serving endpoint can have up to 10 served models.""" + serving endpoint can have up to 15 served models.""" traffic_config: Optional[TrafficConfig] = None """The traffic config defining how invocations to the serving endpoint should be routed.""" @@ -2438,8 +2438,7 @@ def wait_get_serving_endpoint_not_updating( raise TimeoutError(f'timed out after {timeout}: {status_message}') def build_logs(self, name: str, served_model_name: str) -> BuildLogsResponse: - """Retrieve the logs associated with building the model's environment for a given serving endpoint's - served model. + """Get build logs for a served model. Retrieves the build logs associated with the provided served model. @@ -2518,7 +2517,7 @@ def delete(self, name: str): self._api.do('DELETE', f'/api/2.0/serving-endpoints/{name}', headers=headers) def export_metrics(self, name: str): - """Retrieve the metrics associated with a serving endpoint. + """Get metrics of a serving endpoint. Retrieves the metrics associated with the provided serving endpoint in either Prometheus or OpenMetrics exposition format. @@ -2587,7 +2586,7 @@ def get_permissions(self, serving_endpoint_id: str) -> ServingEndpointPermission return ServingEndpointPermissions.from_dict(res) def list(self) -> Iterator[ServingEndpoint]: - """Retrieve all serving endpoints. + """Get all serving endpoints. :returns: Iterator over :class:`ServingEndpoint` """ @@ -2599,7 +2598,7 @@ def list(self) -> Iterator[ServingEndpoint]: return parsed if parsed is not None else [] def logs(self, name: str, served_model_name: str) -> ServerLogsResponse: - """Retrieve the most recent log lines associated with a given serving endpoint's served model. + """Get the latest logs for a served model. Retrieves the service logs associated with the provided served model. @@ -2623,7 +2622,7 @@ def patch(self, *, add_tags: Optional[List[EndpointTag]] = None, delete_tags: Optional[List[str]] = None) -> Iterator[EndpointTag]: - """Patch the tags of a serving endpoint. + """Update tags of a serving endpoint. Used to batch add and delete tags from a serving endpoint with a single API call. @@ -2645,7 +2644,7 @@ def patch(self, return [EndpointTag.from_dict(v) for v in res] def put(self, name: str, *, rate_limits: Optional[List[RateLimit]] = None) -> PutResponse: - """Update the rate limits of a serving endpoint. + """Update rate limits of a serving endpoint. Used to update the rate limits of a serving endpoint. NOTE: only external and foundation model endpoints are supported as of now. @@ -2683,7 +2682,7 @@ def query(self, stop: Optional[List[str]] = None, stream: Optional[bool] = None, temperature: Optional[float] = None) -> QueryEndpointResponse: - """Query a serving endpoint with provided model input. + """Query a serving endpoint. :param name: str The name of the serving endpoint. This field is required. @@ -2789,7 +2788,7 @@ def update_config(self, served_entities: Optional[List[ServedEntityInput]] = None, served_models: Optional[List[ServedModelInput]] = None, traffic_config: Optional[TrafficConfig] = None) -> Wait[ServingEndpointDetailed]: - """Update a serving endpoint with a new config. + """Update config of a serving endpoint. Updates any combination of the serving endpoint's served entities, the compute configuration of those served entities, and the endpoint's traffic config. An endpoint that already has an update in progress @@ -2800,11 +2799,11 @@ def update_config(self, :param auto_capture_config: :class:`AutoCaptureConfigInput` (optional) Configuration for Inference Tables which automatically logs requests and responses to Unity Catalog. :param served_entities: List[:class:`ServedEntityInput`] (optional) - A list of served entities for the endpoint to serve. A serving endpoint can have up to 10 served + A list of served entities for the endpoint to serve. A serving endpoint can have up to 15 served entities. :param served_models: List[:class:`ServedModelInput`] (optional) (Deprecated, use served_entities instead) A list of served models for the endpoint to serve. A - serving endpoint can have up to 10 served models. + serving endpoint can have up to 15 served models. :param traffic_config: :class:`TrafficConfig` (optional) The traffic config defining how invocations to the serving endpoint should be routed. diff --git a/databricks/sdk/service/settings.py b/databricks/sdk/service/settings.py index bf24c80e..e85991e8 100755 --- a/databricks/sdk/service/settings.py +++ b/databricks/sdk/service/settings.py @@ -3271,10 +3271,10 @@ def delete_private_endpoint_rule(self, network_connectivity_config_id: str, private_endpoint_rule_id: str) -> NccAzurePrivateEndpointRule: """Delete a private endpoint rule. - Initiates deleting a private endpoint rule. The private endpoint will be deactivated and will be - purged after seven days of deactivation. When a private endpoint is in deactivated state, - `deactivated` field is set to `true` and the private endpoint is not available to your serverless - compute resources. + Initiates deleting a private endpoint rule. If the connection state is PENDING or EXPIRED, the private + endpoint is immediately deleted. Otherwise, the private endpoint is deactivated and will be deleted + after seven days of deactivation. When a private endpoint is deactivated, the `deactivated` field is + set to `true` and the private endpoint is not available to your serverless compute resources. :param network_connectivity_config_id: str Your Network Connectvity Configuration ID. diff --git a/databricks/sdk/service/sql.py b/databricks/sdk/service/sql.py index 67bcb82e..7bd0cc7d 100755 --- a/databricks/sdk/service/sql.py +++ b/databricks/sdk/service/sql.py @@ -220,7 +220,7 @@ class AlertQuery: """The timestamp at which this query was last updated.""" user_id: Optional[int] = None - """The ID of the user who created this query.""" + """The ID of the user who owns the query.""" def as_dict(self) -> dict: """Serializes the AlertQuery into a dictionary suitable for use as a JSON request body.""" @@ -709,7 +709,7 @@ class Dashboard: user: Optional[User] = None user_id: Optional[int] = None - """The ID of the user that created and owns this dashboard.""" + """The ID of the user who owns the dashboard.""" widgets: Optional[List[Widget]] = None @@ -2304,7 +2304,7 @@ class Query: user: Optional[User] = None user_id: Optional[int] = None - """The ID of the user who created this query.""" + """The ID of the user who owns the query.""" visualizations: Optional[List[Visualization]] = None diff --git a/databricks/sdk/version.py b/databricks/sdk/version.py index e4533712..81edede8 100644 --- a/databricks/sdk/version.py +++ b/databricks/sdk/version.py @@ -1 +1 @@ -__version__ = '0.21.0' +__version__ = '0.22.0' diff --git a/docs/account/settings/network_connectivity.rst b/docs/account/settings/network_connectivity.rst index e95956d2..30b50abc 100644 --- a/docs/account/settings/network_connectivity.rst +++ b/docs/account/settings/network_connectivity.rst @@ -63,10 +63,10 @@ Delete a private endpoint rule. - Initiates deleting a private endpoint rule. The private endpoint will be deactivated and will be - purged after seven days of deactivation. When a private endpoint is in deactivated state, - `deactivated` field is set to `true` and the private endpoint is not available to your serverless - compute resources. + Initiates deleting a private endpoint rule. If the connection state is PENDING or EXPIRED, the private + endpoint is immediately deleted. Otherwise, the private endpoint is deactivated and will be deleted + after seven days of deactivation. When a private endpoint is deactivated, the `deactivated` field is + set to `true` and the private endpoint is not available to your serverless compute resources. :param network_connectivity_config_id: str Your Network Connectvity Configuration ID. diff --git a/docs/dbdataclasses/catalog.rst b/docs/dbdataclasses/catalog.rst index dc1bcf5c..d17e4989 100644 --- a/docs/dbdataclasses/catalog.rst +++ b/docs/dbdataclasses/catalog.rst @@ -362,6 +362,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: CreateOnlineTableRequest + :members: + :undoc-members: + .. autoclass:: CreateRegisteredModelRequest :members: :undoc-members: @@ -1362,10 +1366,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: SKIP :value: "SKIP" -.. autoclass:: ViewData - :members: - :undoc-members: - .. autoclass:: VolumeInfo :members: :undoc-members: diff --git a/docs/dbdataclasses/dashboards.rst b/docs/dbdataclasses/dashboards.rst index 4510a5b0..a843e320 100644 --- a/docs/dbdataclasses/dashboards.rst +++ b/docs/dbdataclasses/dashboards.rst @@ -4,10 +4,34 @@ Dashboards These dataclasses are used in the SDK to represent API requests and responses for services in the ``databricks.sdk.service.dashboards`` module. .. py:currentmodule:: databricks.sdk.service.dashboards +.. autoclass:: CreateDashboardRequest + :members: + :undoc-members: + +.. autoclass:: Dashboard + :members: + :undoc-members: + +.. py:class:: LifecycleState + + .. py:attribute:: ACTIVE + :value: "ACTIVE" + + .. py:attribute:: TRASHED + :value: "TRASHED" + .. autoclass:: PublishRequest :members: :undoc-members: -.. autoclass:: PublishResponse +.. autoclass:: PublishedDashboard + :members: + :undoc-members: + +.. autoclass:: TrashDashboardResponse + :members: + :undoc-members: + +.. autoclass:: UpdateDashboardRequest :members: :undoc-members: diff --git a/docs/dbdataclasses/iam.rst b/docs/dbdataclasses/iam.rst index e3c73d07..a095098b 100644 --- a/docs/dbdataclasses/iam.rst +++ b/docs/dbdataclasses/iam.rst @@ -191,6 +191,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: CAN_MANAGE_STAGING_VERSIONS :value: "CAN_MANAGE_STAGING_VERSIONS" + .. py:attribute:: CAN_QUERY + :value: "CAN_QUERY" + .. py:attribute:: CAN_READ :value: "CAN_READ" diff --git a/docs/workspace/catalog/catalogs.rst b/docs/workspace/catalog/catalogs.rst index 5592152b..5bc7b083 100644 --- a/docs/workspace/catalog/catalogs.rst +++ b/docs/workspace/catalog/catalogs.rst @@ -71,7 +71,7 @@ - .. py:method:: get(name: str) -> CatalogInfo + .. py:method:: get(name: str [, include_browse: Optional[bool]]) -> CatalogInfo Usage: @@ -98,11 +98,14 @@ :param name: str The name of the catalog. + :param include_browse: bool (optional) + Whether to include catalogs in the response for which the principal can only access selective + metadata for :returns: :class:`CatalogInfo` - .. py:method:: list() -> Iterator[CatalogInfo] + .. py:method:: list( [, include_browse: Optional[bool]]) -> Iterator[CatalogInfo] Usage: @@ -122,6 +125,10 @@ **USE_CATALOG** privilege) will be retrieved. There is no guarantee of a specific ordering of the elements in the array. + :param include_browse: bool (optional) + Whether to include catalogs in the response for which the principal can only access selective + metadata for + :returns: Iterator over :class:`CatalogInfo` diff --git a/docs/workspace/catalog/external_locations.rst b/docs/workspace/catalog/external_locations.rst index e9e86fb4..90b4416c 100644 --- a/docs/workspace/catalog/external_locations.rst +++ b/docs/workspace/catalog/external_locations.rst @@ -86,7 +86,7 @@ - .. py:method:: get(name: str) -> ExternalLocationInfo + .. py:method:: get(name: str [, include_browse: Optional[bool]]) -> ExternalLocationInfo Usage: @@ -122,11 +122,14 @@ :param name: str Name of the external location. + :param include_browse: bool (optional) + Whether to include external locations in the response for which the principal can only access + selective metadata for :returns: :class:`ExternalLocationInfo` - .. py:method:: list( [, max_results: Optional[int], page_token: Optional[str]]) -> Iterator[ExternalLocationInfo] + .. py:method:: list( [, include_browse: Optional[bool], max_results: Optional[int], page_token: Optional[str]]) -> Iterator[ExternalLocationInfo] Usage: @@ -144,9 +147,11 @@ Gets an array of external locations (__ExternalLocationInfo__ objects) from the metastore. The caller must be a metastore admin, the owner of the external location, or a user that has some privilege on - the external location. For unpaginated request, there is no guarantee of a specific ordering of the - elements in the array. For paginated request, elements are ordered by their name. + the external location. There is no guarantee of a specific ordering of the elements in the array. + :param include_browse: bool (optional) + Whether to include external locations in the response for which the principal can only access + selective metadata for :param max_results: int (optional) Maximum number of external locations to return. If not set, all the external locations are returned (not recommended). - when set to a value greater than 0, the page length is the minimum of this diff --git a/docs/workspace/catalog/functions.rst b/docs/workspace/catalog/functions.rst index 2cc57229..97398be8 100644 --- a/docs/workspace/catalog/functions.rst +++ b/docs/workspace/catalog/functions.rst @@ -45,7 +45,7 @@ - .. py:method:: get(name: str) -> FunctionInfo + .. py:method:: get(name: str [, include_browse: Optional[bool]]) -> FunctionInfo Get a function. @@ -59,25 +59,30 @@ :param name: str The fully-qualified name of the function (of the form __catalog_name__.__schema_name__.__function__name__). + :param include_browse: bool (optional) + Whether to include functions in the response for which the principal can only access selective + metadata for :returns: :class:`FunctionInfo` - .. py:method:: list(catalog_name: str, schema_name: str [, max_results: Optional[int], page_token: Optional[str]]) -> Iterator[FunctionInfo] + .. py:method:: list(catalog_name: str, schema_name: str [, include_browse: Optional[bool], max_results: Optional[int], page_token: Optional[str]]) -> Iterator[FunctionInfo] List functions. List functions within the specified parent catalog and schema. If the user is a metastore admin, all functions are returned in the output list. Otherwise, the user must have the **USE_CATALOG** privilege on the catalog and the **USE_SCHEMA** privilege on the schema, and the output list contains only - functions for which either the user has the **EXECUTE** privilege or the user is the owner. For - unpaginated request, there is no guarantee of a specific ordering of the elements in the array. For - paginated request, elements are ordered by their name. + functions for which either the user has the **EXECUTE** privilege or the user is the owner. There is + no guarantee of a specific ordering of the elements in the array. :param catalog_name: str Name of parent catalog for functions of interest. :param schema_name: str Parent schema of functions. + :param include_browse: bool (optional) + Whether to include functions in the response for which the principal can only access selective + metadata for :param max_results: int (optional) Maximum number of functions to return. If not set, all the functions are returned (not recommended). - when set to a value greater than 0, the page length is the minimum of this value and a server diff --git a/docs/workspace/catalog/lakehouse_monitors.rst b/docs/workspace/catalog/lakehouse_monitors.rst index 94a51a7a..453dbf73 100644 --- a/docs/workspace/catalog/lakehouse_monitors.rst +++ b/docs/workspace/catalog/lakehouse_monitors.rst @@ -32,7 +32,7 @@ - .. py:method:: create(full_name: str, assets_dir: str, output_schema_name: str [, baseline_table_name: Optional[str], custom_metrics: Optional[List[MonitorCustomMetric]], data_classification_config: Optional[MonitorDataClassificationConfig], inference_log: Optional[MonitorInferenceLogProfileType], notifications: Optional[List[MonitorNotificationsConfig]], schedule: Optional[MonitorCronSchedule], skip_builtin_dashboard: Optional[bool], slicing_exprs: Optional[List[str]], snapshot: Optional[MonitorSnapshotProfileType], time_series: Optional[MonitorTimeSeriesProfileType], warehouse_id: Optional[str]]) -> MonitorInfo + .. py:method:: create(full_name: str, assets_dir: str, output_schema_name: str [, baseline_table_name: Optional[str], custom_metrics: Optional[List[MonitorCustomMetric]], data_classification_config: Optional[MonitorDataClassificationConfig], inference_log: Optional[MonitorInferenceLogProfileType], notifications: Optional[MonitorNotificationsConfig], schedule: Optional[MonitorCronSchedule], skip_builtin_dashboard: Optional[bool], slicing_exprs: Optional[List[str]], snapshot: Optional[MonitorSnapshotProfileType], time_series: Optional[MonitorTimeSeriesProfileType], warehouse_id: Optional[str]]) -> MonitorInfo Create a table monitor. @@ -62,7 +62,7 @@ The data classification config for the monitor. :param inference_log: :class:`MonitorInferenceLogProfileType` (optional) Configuration for monitoring inference logs. - :param notifications: List[:class:`MonitorNotificationsConfig`] (optional) + :param notifications: :class:`MonitorNotificationsConfig` (optional) The notification settings for the monitor. :param schedule: :class:`MonitorCronSchedule` (optional) The schedule for automatically updating and refreshing metric tables. @@ -186,7 +186,7 @@ :returns: :class:`MonitorRefreshInfo` - .. py:method:: update(full_name: str, output_schema_name: str [, baseline_table_name: Optional[str], custom_metrics: Optional[List[MonitorCustomMetric]], data_classification_config: Optional[MonitorDataClassificationConfig], inference_log: Optional[MonitorInferenceLogProfileType], notifications: Optional[List[MonitorNotificationsConfig]], schedule: Optional[MonitorCronSchedule], slicing_exprs: Optional[List[str]], snapshot: Optional[MonitorSnapshotProfileType], time_series: Optional[MonitorTimeSeriesProfileType]]) -> MonitorInfo + .. py:method:: update(full_name: str, output_schema_name: str [, baseline_table_name: Optional[str], custom_metrics: Optional[List[MonitorCustomMetric]], data_classification_config: Optional[MonitorDataClassificationConfig], inference_log: Optional[MonitorInferenceLogProfileType], notifications: Optional[MonitorNotificationsConfig], schedule: Optional[MonitorCronSchedule], slicing_exprs: Optional[List[str]], snapshot: Optional[MonitorSnapshotProfileType], time_series: Optional[MonitorTimeSeriesProfileType]]) -> MonitorInfo Update a table monitor. @@ -216,7 +216,7 @@ The data classification config for the monitor. :param inference_log: :class:`MonitorInferenceLogProfileType` (optional) Configuration for monitoring inference logs. - :param notifications: List[:class:`MonitorNotificationsConfig`] (optional) + :param notifications: :class:`MonitorNotificationsConfig` (optional) The notification settings for the monitor. :param schedule: :class:`MonitorCronSchedule` (optional) The schedule for automatically updating and refreshing metric tables. diff --git a/docs/workspace/catalog/model_versions.rst b/docs/workspace/catalog/model_versions.rst index 9b609f30..9dc39287 100644 --- a/docs/workspace/catalog/model_versions.rst +++ b/docs/workspace/catalog/model_versions.rst @@ -30,7 +30,7 @@ - .. py:method:: get(full_name: str, version: int) -> RegisteredModelInfo + .. py:method:: get(full_name: str, version: int [, include_browse: Optional[bool]]) -> RegisteredModelInfo Get a Model Version. @@ -44,6 +44,9 @@ The three-level (fully qualified) name of the model version :param version: int The integer version number of the model version + :param include_browse: bool (optional) + Whether to include model versions in the response for which the principal can only access selective + metadata for :returns: :class:`RegisteredModelInfo` @@ -66,7 +69,7 @@ :returns: :class:`ModelVersionInfo` - .. py:method:: list(full_name: str [, max_results: Optional[int], page_token: Optional[str]]) -> Iterator[ModelVersionInfo] + .. py:method:: list(full_name: str [, include_browse: Optional[bool], max_results: Optional[int], page_token: Optional[str]]) -> Iterator[ModelVersionInfo] List Model Versions. @@ -83,6 +86,9 @@ :param full_name: str The full three-level name of the registered model under which to list model versions + :param include_browse: bool (optional) + Whether to include model versions in the response for which the principal can only access selective + metadata for :param max_results: int (optional) Maximum number of model versions to return. If not set, the page length is set to a server configured value (100, as of 1/3/2024). - when set to a value greater than 0, the page length is the diff --git a/docs/workspace/catalog/registered_models.rst b/docs/workspace/catalog/registered_models.rst index 09d29e55..d08c6aa2 100644 --- a/docs/workspace/catalog/registered_models.rst +++ b/docs/workspace/catalog/registered_models.rst @@ -91,7 +91,7 @@ - .. py:method:: get(full_name: str) -> RegisteredModelInfo + .. py:method:: get(full_name: str [, include_browse: Optional[bool]]) -> RegisteredModelInfo Get a Registered Model. @@ -103,11 +103,14 @@ :param full_name: str The three-level (fully qualified) name of the registered model + :param include_browse: bool (optional) + Whether to include registered models in the response for which the principal can only access + selective metadata for :returns: :class:`RegisteredModelInfo` - .. py:method:: list( [, catalog_name: Optional[str], max_results: Optional[int], page_token: Optional[str], schema_name: Optional[str]]) -> Iterator[RegisteredModelInfo] + .. py:method:: list( [, catalog_name: Optional[str], include_browse: Optional[bool], max_results: Optional[int], page_token: Optional[str], schema_name: Optional[str]]) -> Iterator[RegisteredModelInfo] List Registered Models. @@ -125,6 +128,9 @@ :param catalog_name: str (optional) The identifier of the catalog under which to list registered models. If specified, schema_name must be specified. + :param include_browse: bool (optional) + Whether to include registered models in the response for which the principal can only access + selective metadata for :param max_results: int (optional) Max number of registered models to return. If catalog and schema are unspecified, max_results must be specified. If max_results is unspecified, we return all results, starting from the page specified diff --git a/docs/workspace/catalog/schemas.rst b/docs/workspace/catalog/schemas.rst index 7453521b..1c9fcbbd 100644 --- a/docs/workspace/catalog/schemas.rst +++ b/docs/workspace/catalog/schemas.rst @@ -62,7 +62,7 @@ - .. py:method:: get(full_name: str) -> SchemaInfo + .. py:method:: get(full_name: str [, include_browse: Optional[bool]]) -> SchemaInfo Usage: @@ -92,11 +92,14 @@ :param full_name: str Full name of the schema. + :param include_browse: bool (optional) + Whether to include schemas in the response for which the principal can only access selective + metadata for :returns: :class:`SchemaInfo` - .. py:method:: list(catalog_name: str [, max_results: Optional[int], page_token: Optional[str]]) -> Iterator[SchemaInfo] + .. py:method:: list(catalog_name: str [, include_browse: Optional[bool], max_results: Optional[int], page_token: Optional[str]]) -> Iterator[SchemaInfo] Usage: @@ -120,12 +123,14 @@ Gets an array of schemas for a catalog in the metastore. If the caller is the metastore admin or the owner of the parent catalog, all schemas for the catalog will be retrieved. Otherwise, only schemas - owned by the caller (or for which the caller has the **USE_SCHEMA** privilege) will be retrieved. For - unpaginated request, there is no guarantee of a specific ordering of the elements in the array. For - paginated request, elements are ordered by their name. + owned by the caller (or for which the caller has the **USE_SCHEMA** privilege) will be retrieved. + There is no guarantee of a specific ordering of the elements in the array. :param catalog_name: str Parent catalog for schemas of interest. + :param include_browse: bool (optional) + Whether to include schemas in the response for which the principal can only access selective + metadata for :param max_results: int (optional) Maximum number of schemas to return. If not set, all the schemas are returned (not recommended). - when set to a value greater than 0, the page length is the minimum of this value and a server diff --git a/docs/workspace/catalog/storage_credentials.rst b/docs/workspace/catalog/storage_credentials.rst index 501ba21e..c055fefb 100644 --- a/docs/workspace/catalog/storage_credentials.rst +++ b/docs/workspace/catalog/storage_credentials.rst @@ -130,9 +130,8 @@ Gets an array of storage credentials (as __StorageCredentialInfo__ objects). The array is limited to only those storage credentials the caller has permission to access. If the caller is a metastore - admin, retrieval of credentials is unrestricted. For unpaginated request, there is no guarantee of a - specific ordering of the elements in the array. For paginated request, elements are ordered by their - name. + admin, retrieval of credentials is unrestricted. There is no guarantee of a specific ordering of the + elements in the array. :param max_results: int (optional) Maximum number of storage credentials to return. If not set, all the storage credentials are diff --git a/docs/workspace/catalog/tables.rst b/docs/workspace/catalog/tables.rst index c296e40c..6249f0da 100644 --- a/docs/workspace/catalog/tables.rst +++ b/docs/workspace/catalog/tables.rst @@ -45,7 +45,7 @@ :returns: :class:`TableExistsResponse` - .. py:method:: get(full_name: str [, include_delta_metadata: Optional[bool]]) -> TableInfo + .. py:method:: get(full_name: str [, include_browse: Optional[bool], include_delta_metadata: Optional[bool]]) -> TableInfo Usage: @@ -89,13 +89,16 @@ :param full_name: str Full name of the table. + :param include_browse: bool (optional) + Whether to include tables in the response for which the principal can only access selective metadata + for :param include_delta_metadata: bool (optional) Whether delta metadata should be included in the response. :returns: :class:`TableInfo` - .. py:method:: list(catalog_name: str, schema_name: str [, include_delta_metadata: Optional[bool], max_results: Optional[int], omit_columns: Optional[bool], omit_properties: Optional[bool], page_token: Optional[str]]) -> Iterator[TableInfo] + .. py:method:: list(catalog_name: str, schema_name: str [, include_browse: Optional[bool], include_delta_metadata: Optional[bool], max_results: Optional[int], omit_columns: Optional[bool], omit_properties: Optional[bool], page_token: Optional[str]]) -> Iterator[TableInfo] Usage: @@ -130,6 +133,9 @@ Name of parent catalog for tables of interest. :param schema_name: str Parent schema of tables. + :param include_browse: bool (optional) + Whether to include tables in the response for which the principal can only access selective metadata + for :param include_delta_metadata: bool (optional) Whether delta metadata should be included in the response. :param max_results: int (optional) diff --git a/docs/workspace/catalog/volumes.rst b/docs/workspace/catalog/volumes.rst index 04a5bc4f..564e6768 100644 --- a/docs/workspace/catalog/volumes.rst +++ b/docs/workspace/catalog/volumes.rst @@ -103,7 +103,7 @@ - .. py:method:: list(catalog_name: str, schema_name: str [, max_results: Optional[int], page_token: Optional[str]]) -> Iterator[VolumeInfo] + .. py:method:: list(catalog_name: str, schema_name: str [, include_browse: Optional[bool], max_results: Optional[int], page_token: Optional[str]]) -> Iterator[VolumeInfo] Usage: @@ -142,6 +142,9 @@ The identifier of the catalog :param schema_name: str The identifier of the schema + :param include_browse: bool (optional) + Whether to include volumes in the response for which the principal can only access selective + metadata for :param max_results: int (optional) Maximum number of volumes to return (page length). @@ -161,7 +164,7 @@ :returns: Iterator over :class:`VolumeInfo` - .. py:method:: read(name: str) -> VolumeInfo + .. py:method:: read(name: str [, include_browse: Optional[bool]]) -> VolumeInfo Usage: @@ -216,6 +219,9 @@ :param name: str The three-level (fully qualified) name of the volume + :param include_browse: bool (optional) + Whether to include volumes in the response for which the principal can only access selective + metadata for :returns: :class:`VolumeInfo` diff --git a/docs/workspace/compute/clusters.rst b/docs/workspace/compute/clusters.rst index a9e3d986..84f2b796 100644 --- a/docs/workspace/compute/clusters.rst +++ b/docs/workspace/compute/clusters.rst @@ -865,8 +865,8 @@ :param latest: bool :param ml: bool :param gpu: bool - :param scala: bool - :param spark_version: bool + :param scala: str + :param spark_version: str :param photon: bool :param graviton: bool diff --git a/docs/workspace/dashboards/lakeview.rst b/docs/workspace/dashboards/lakeview.rst index 56e9bfb4..b0cd9076 100644 --- a/docs/workspace/dashboards/lakeview.rst +++ b/docs/workspace/dashboards/lakeview.rst @@ -7,7 +7,50 @@ These APIs provide specific management operations for Lakeview dashboards. Generic resource management can be done with Workspace API (import, export, get-status, list, delete). - .. py:method:: publish(dashboard_id: str [, embed_credentials: Optional[bool], warehouse_id: Optional[str]]) + .. py:method:: create(display_name: str [, parent_path: Optional[str], serialized_dashboard: Optional[str], warehouse_id: Optional[str]]) -> Dashboard + + Create dashboard. + + Create a draft dashboard. + + :param display_name: str + The display name of the dashboard. + :param parent_path: str (optional) + The workspace path of the folder containing the dashboard. Includes leading slash and no trailing + slash. + :param serialized_dashboard: str (optional) + The contents of the dashboard in serialized string form. + :param warehouse_id: str (optional) + The warehouse ID used to run the dashboard. + + :returns: :class:`Dashboard` + + + .. py:method:: get(dashboard_id: str) -> Dashboard + + Get dashboard. + + Get a draft dashboard. + + :param dashboard_id: str + UUID identifying the dashboard. + + :returns: :class:`Dashboard` + + + .. py:method:: get_published(dashboard_id: str) -> PublishedDashboard + + Get published dashboard. + + Get the current published dashboard. + + :param dashboard_id: str + UUID identifying the dashboard to be published. + + :returns: :class:`PublishedDashboard` + + + .. py:method:: publish(dashboard_id: str [, embed_credentials: Optional[bool], warehouse_id: Optional[str]]) -> PublishedDashboard Publish dashboard. @@ -21,5 +64,38 @@ :param warehouse_id: str (optional) The ID of the warehouse that can be used to override the warehouse which was set in the draft. + :returns: :class:`PublishedDashboard` + + + .. py:method:: trash(dashboard_id: str) + + Trash dashboard. + + Trash a dashboard. + + :param dashboard_id: str + UUID identifying the dashboard. + + + + + .. py:method:: update(dashboard_id: str [, display_name: Optional[str], etag: Optional[str], serialized_dashboard: Optional[str], warehouse_id: Optional[str]]) -> Dashboard + + Update dashboard. + + Update a draft dashboard. + + :param dashboard_id: str + UUID identifying the dashboard. + :param display_name: str (optional) + The display name of the dashboard. + :param etag: str (optional) + The etag for the dashboard. Can be optionally provided on updates to ensure that the dashboard has + not been modified since the last read. + :param serialized_dashboard: str (optional) + The contents of the dashboard in serialized string form. + :param warehouse_id: str (optional) + The warehouse ID used to run the dashboard. + :returns: :class:`Dashboard` \ No newline at end of file diff --git a/docs/workspace/serving/serving_endpoints.rst b/docs/workspace/serving/serving_endpoints.rst index 8972b087..141dd170 100644 --- a/docs/workspace/serving/serving_endpoints.rst +++ b/docs/workspace/serving/serving_endpoints.rst @@ -17,8 +17,7 @@ .. py:method:: build_logs(name: str, served_model_name: str) -> BuildLogsResponse - Retrieve the logs associated with building the model's environment for a given serving endpoint's - served model. + Get build logs for a served model. Retrieves the build logs associated with the provided served model. @@ -65,7 +64,7 @@ .. py:method:: export_metrics(name: str) - Retrieve the metrics associated with a serving endpoint. + Get metrics of a serving endpoint. Retrieves the metrics associated with the provided serving endpoint in either Prometheus or OpenMetrics exposition format. @@ -115,14 +114,14 @@ .. py:method:: list() -> Iterator[ServingEndpoint] - Retrieve all serving endpoints. + Get all serving endpoints. :returns: Iterator over :class:`ServingEndpoint` .. py:method:: logs(name: str, served_model_name: str) -> ServerLogsResponse - Retrieve the most recent log lines associated with a given serving endpoint's served model. + Get the latest logs for a served model. Retrieves the service logs associated with the provided served model. @@ -136,7 +135,7 @@ .. py:method:: patch(name: str [, add_tags: Optional[List[EndpointTag]], delete_tags: Optional[List[str]]]) -> Iterator[EndpointTag] - Patch the tags of a serving endpoint. + Update tags of a serving endpoint. Used to batch add and delete tags from a serving endpoint with a single API call. @@ -152,7 +151,7 @@ .. py:method:: put(name: str [, rate_limits: Optional[List[RateLimit]]]) -> PutResponse - Update the rate limits of a serving endpoint. + Update rate limits of a serving endpoint. Used to update the rate limits of a serving endpoint. NOTE: only external and foundation model endpoints are supported as of now. @@ -167,7 +166,7 @@ .. py:method:: query(name: str [, dataframe_records: Optional[List[Any]], dataframe_split: Optional[DataframeSplitInput], extra_params: Optional[Dict[str, str]], input: Optional[Any], inputs: Optional[Any], instances: Optional[List[Any]], max_tokens: Optional[int], messages: Optional[List[ChatMessage]], n: Optional[int], prompt: Optional[Any], stop: Optional[List[str]], stream: Optional[bool], temperature: Optional[float]]) -> QueryEndpointResponse - Query a serving endpoint with provided model input. + Query a serving endpoint. :param name: str The name of the serving endpoint. This field is required. @@ -232,7 +231,7 @@ .. py:method:: update_config(name: str [, auto_capture_config: Optional[AutoCaptureConfigInput], served_entities: Optional[List[ServedEntityInput]], served_models: Optional[List[ServedModelInput]], traffic_config: Optional[TrafficConfig]]) -> Wait[ServingEndpointDetailed] - Update a serving endpoint with a new config. + Update config of a serving endpoint. Updates any combination of the serving endpoint's served entities, the compute configuration of those served entities, and the endpoint's traffic config. An endpoint that already has an update in progress @@ -243,11 +242,11 @@ :param auto_capture_config: :class:`AutoCaptureConfigInput` (optional) Configuration for Inference Tables which automatically logs requests and responses to Unity Catalog. :param served_entities: List[:class:`ServedEntityInput`] (optional) - A list of served entities for the endpoint to serve. A serving endpoint can have up to 10 served + A list of served entities for the endpoint to serve. A serving endpoint can have up to 15 served entities. :param served_models: List[:class:`ServedModelInput`] (optional) (Deprecated, use served_entities instead) A list of served models for the endpoint to serve. A - serving endpoint can have up to 10 served models. + serving endpoint can have up to 15 served models. :param traffic_config: :class:`TrafficConfig` (optional) The traffic config defining how invocations to the serving endpoint should be routed.