From 76a1933aece74e98857128c37950bc4fd3f659d9 Mon Sep 17 00:00:00 2001 From: Kartik Gupta <88345179+kartikgupta-db@users.noreply.github.com> Date: Wed, 20 Dec 2023 18:11:45 +0530 Subject: [PATCH] Release v0.16.0 (#485) * Sort imports in service template ([#479](https://github.com/databricks/databricks-sdk-py/pull/479)). * Add `py.typed` to support PEP-561 ([#483](https://github.com/databricks/databricks-sdk-py/pull/483)). * Fixed bug in `@retried` when exception subtypes were not respected ([#484](https://github.com/databricks/databricks-sdk-py/pull/484)). * Make `WorkspaceClient` and `AccountClient` more friendly with autospeccing ([#480](https://github.com/databricks/databricks-sdk-py/pull/480)). API Changes: * Added `azure_workspace_info` field for `databricks.sdk.service.provisioning.Workspace`. * Added `databricks.sdk.service.provisioning.AzureWorkspaceInfo` dataclass. * Changed `update_config()` method for [w.serving_endpoints](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/serving_endpoints.html) workspace-level service with new required argument order. * Changed `served_entities` field for `databricks.sdk.service.serving.EndpointCoreConfigInput` to no longer be required. * Changed `create()` method for [a.account_ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_ip_access_lists.html) account-level service with new required argument order. * Changed `replace()` method for [a.account_ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_ip_access_lists.html) account-level service with new required argument order. * Changed `update()` method for [a.account_ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_ip_access_lists.html) account-level service with new required argument order. * Changed `create()` method for [w.ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ip_access_lists.html) workspace-level service with new required argument order. * Changed `replace()` method for [w.ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ip_access_lists.html) workspace-level service with new required argument order. * Changed `update()` method for [w.ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ip_access_lists.html) workspace-level service with new required argument order. * Changed `ip_addresses` field for `databricks.sdk.service.settings.CreateIpAccessList` to no longer be required. * Changed `ip_addresses` field for `databricks.sdk.service.settings.ReplaceIpAccessList` to no longer be required. * Removed `list_id` field for `databricks.sdk.service.settings.ReplaceIpAccessList`. * Changed `enabled` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. * Changed `ip_addresses` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. * Changed `label` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. * Removed `list_id` field for `databricks.sdk.service.settings.UpdateIpAccessList`. * Changed `list_type` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. OpenAPI SHA: d3853c8dee5806d04da2ae8910f273ffb35719a5, Date: 2023-12-14 --- .codegen/_openapi_sha | 2 +- CHANGELOG.md | 30 +++++ databricks/sdk/service/iam.py | 20 +++- databricks/sdk/service/provisioning.py | 26 ++++ databricks/sdk/service/serving.py | 18 +-- databricks/sdk/service/settings.py | 157 ++++++++++++------------- databricks/sdk/service/sql.py | 46 ++++++-- databricks/sdk/version.py | 2 +- 8 files changed, 194 insertions(+), 107 deletions(-) diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 0d79c490d..2c3fb6e13 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -63caa3cb0c05045e81d3dcf2451fa990d8670f36 \ No newline at end of file +d3853c8dee5806d04da2ae8910f273ffb35719a5 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e415cc35..18408cfee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,35 @@ # Version changelog +## 0.16.0 + +* Sort imports in service template ([#479](https://github.com/databricks/databricks-sdk-py/pull/479)). +* Add `py.typed` to support PEP-561 ([#483](https://github.com/databricks/databricks-sdk-py/pull/483)). +* Fixed bug in `@retried` when exception subtypes were not respected ([#484](https://github.com/databricks/databricks-sdk-py/pull/484)). +* Make `WorkspaceClient` and `AccountClient` more friendly with autospeccing ([#480](https://github.com/databricks/databricks-sdk-py/pull/480)). + +API Changes: + + * Added `azure_workspace_info` field for `databricks.sdk.service.provisioning.Workspace`. + * Added `databricks.sdk.service.provisioning.AzureWorkspaceInfo` dataclass. + * Changed `update_config()` method for [w.serving_endpoints](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/serving_endpoints.html) workspace-level service with new required argument order. + * Changed `served_entities` field for `databricks.sdk.service.serving.EndpointCoreConfigInput` to no longer be required. + * Changed `create()` method for [a.account_ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_ip_access_lists.html) account-level service with new required argument order. + * Changed `replace()` method for [a.account_ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_ip_access_lists.html) account-level service with new required argument order. + * Changed `update()` method for [a.account_ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_ip_access_lists.html) account-level service with new required argument order. + * Changed `create()` method for [w.ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ip_access_lists.html) workspace-level service with new required argument order. + * Changed `replace()` method for [w.ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ip_access_lists.html) workspace-level service with new required argument order. + * Changed `update()` method for [w.ip_access_lists](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ip_access_lists.html) workspace-level service with new required argument order. + * Changed `ip_addresses` field for `databricks.sdk.service.settings.CreateIpAccessList` to no longer be required. + * Changed `ip_addresses` field for `databricks.sdk.service.settings.ReplaceIpAccessList` to no longer be required. + * Removed `list_id` field for `databricks.sdk.service.settings.ReplaceIpAccessList`. + * Changed `enabled` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. + * Changed `ip_addresses` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. + * Changed `label` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. + * Removed `list_id` field for `databricks.sdk.service.settings.UpdateIpAccessList`. + * Changed `list_type` field for `databricks.sdk.service.settings.UpdateIpAccessList` to no longer be required. + +OpenAPI SHA: d3853c8dee5806d04da2ae8910f273ffb35719a5, Date: 2023-12-14 + ## 0.15.0 Bugfixes: diff --git a/databricks/sdk/service/iam.py b/databricks/sdk/service/iam.py index 36a3cd061..b1f4dcbf5 100755 --- a/databricks/sdk/service/iam.py +++ b/databricks/sdk/service/iam.py @@ -789,9 +789,12 @@ class PermissionsRequest: access_control_list: Optional[List[AccessControlRequest]] = None request_object_id: Optional[str] = None + """The id of the request object.""" request_object_type: Optional[str] = None - """""" + """The type of the request object. Can be one of the following: authorization, clusters, + cluster-policies, directories, experiments, files, instance-pools, jobs, notebooks, pipelines, + registered-models, repos, serving-endpoints, or sql-warehouses.""" def as_dict(self) -> dict: """Serializes the PermissionsRequest into a dictionary suitable for use as a JSON request body.""" @@ -2403,8 +2406,11 @@ def get(self, request_object_type: str, request_object_id: str) -> ObjectPermiss object. :param request_object_type: str - + The type of the request object. Can be one of the following: authorization, clusters, + cluster-policies, directories, experiments, files, instance-pools, jobs, notebooks, pipelines, + registered-models, repos, serving-endpoints, or sql-warehouses. :param request_object_id: str + The id of the request object. :returns: :class:`ObjectPermissions` """ @@ -2446,8 +2452,11 @@ def set(self, object. :param request_object_type: str - + The type of the request object. Can be one of the following: authorization, clusters, + cluster-policies, directories, experiments, files, instance-pools, jobs, notebooks, pipelines, + registered-models, repos, serving-endpoints, or sql-warehouses. :param request_object_id: str + The id of the request object. :param access_control_list: List[:class:`AccessControlRequest`] (optional) :returns: :class:`ObjectPermissions` @@ -2473,8 +2482,11 @@ def update(self, root object. :param request_object_type: str - + The type of the request object. Can be one of the following: authorization, clusters, + cluster-policies, directories, experiments, files, instance-pools, jobs, notebooks, pipelines, + registered-models, repos, serving-endpoints, or sql-warehouses. :param request_object_id: str + The id of the request object. :param access_control_list: List[:class:`AccessControlRequest`] (optional) :returns: :class:`ObjectPermissions` diff --git a/databricks/sdk/service/provisioning.py b/databricks/sdk/service/provisioning.py index f002a5257..7633d230a 100755 --- a/databricks/sdk/service/provisioning.py +++ b/databricks/sdk/service/provisioning.py @@ -69,6 +69,28 @@ def from_dict(cls, d: Dict[str, any]) -> AwsKeyInfo: reuse_key_for_cluster_volumes=d.get('reuse_key_for_cluster_volumes', None)) +@dataclass +class AzureWorkspaceInfo: + resource_group: Optional[str] = None + """Azure Resource Group name""" + + subscription_id: Optional[str] = None + """Azure Subscription ID""" + + def as_dict(self) -> dict: + """Serializes the AzureWorkspaceInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.resource_group is not None: body['resource_group'] = self.resource_group + if self.subscription_id is not None: body['subscription_id'] = self.subscription_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> AzureWorkspaceInfo: + """Deserializes the AzureWorkspaceInfo from a dictionary.""" + return cls(resource_group=d.get('resource_group', None), + subscription_id=d.get('subscription_id', None)) + + @dataclass class CloudResourceContainer: """The general workspace configurations that are specific to cloud providers.""" @@ -1356,6 +1378,8 @@ class Workspace: aws_region: Optional[str] = None """The AWS region of the workspace data plane (for example, `us-west-2`).""" + azure_workspace_info: Optional[AzureWorkspaceInfo] = None + cloud: Optional[str] = None """The cloud name. This field always has the value `gcp`.""" @@ -1452,6 +1476,7 @@ def as_dict(self) -> dict: body = {} if self.account_id is not None: body['account_id'] = self.account_id if self.aws_region is not None: body['aws_region'] = self.aws_region + if self.azure_workspace_info: body['azure_workspace_info'] = self.azure_workspace_info.as_dict() if self.cloud is not None: body['cloud'] = self.cloud if self.cloud_resource_container: body['cloud_resource_container'] = self.cloud_resource_container.as_dict() @@ -1485,6 +1510,7 @@ def from_dict(cls, d: Dict[str, any]) -> Workspace: """Deserializes the Workspace from a dictionary.""" return cls(account_id=d.get('account_id', None), aws_region=d.get('aws_region', None), + azure_workspace_info=_from_dict(d, 'azure_workspace_info', AzureWorkspaceInfo), cloud=d.get('cloud', None), cloud_resource_container=_from_dict(d, 'cloud_resource_container', CloudResourceContainer), creation_time=d.get('creation_time', None), diff --git a/databricks/sdk/service/serving.py b/databricks/sdk/service/serving.py index 9a3347d77..b0d8e7f5d 100755 --- a/databricks/sdk/service/serving.py +++ b/databricks/sdk/service/serving.py @@ -545,10 +545,6 @@ class EmbeddingsV1ResponseEmbeddingElementObject(Enum): @dataclass class EndpointCoreConfigInput: - served_entities: List[ServedEntityInput] - """A list of served entities for the endpoint to serve. A serving endpoint can have up to 10 served - entities.""" - auto_capture_config: Optional[AutoCaptureConfigInput] = None """Configuration for Inference Tables which automatically logs requests and responses to Unity Catalog.""" @@ -556,6 +552,10 @@ class EndpointCoreConfigInput: name: Optional[str] = None """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 + 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.""" @@ -2721,9 +2721,9 @@ def set_permissions( def update_config(self, name: str, - served_entities: List[ServedEntityInput], *, auto_capture_config: Optional[AutoCaptureConfigInput] = None, + 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. @@ -2734,11 +2734,11 @@ def update_config(self, :param name: str The name of the serving endpoint to update. This field is required. - :param served_entities: List[:class:`ServedEntityInput`] - A list of served entities for the endpoint to serve. A serving endpoint can have up to 10 served - entities. :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 + 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. @@ -2766,9 +2766,9 @@ def update_config(self, def update_config_and_wait( self, name: str, - served_entities: List[ServedEntityInput], *, auto_capture_config: Optional[AutoCaptureConfigInput] = None, + served_entities: Optional[List[ServedEntityInput]] = None, served_models: Optional[List[ServedModelInput]] = None, traffic_config: Optional[TrafficConfig] = None, timeout=timedelta(minutes=20)) -> ServingEndpointDetailed: diff --git a/databricks/sdk/service/settings.py b/databricks/sdk/service/settings.py index c626f0ae7..15bca6405 100755 --- a/databricks/sdk/service/settings.py +++ b/databricks/sdk/service/settings.py @@ -16,6 +16,8 @@ @dataclass class CreateIpAccessList: + """Details required to configure a block list or allow list.""" + label: str """Label for the IP access list. This **cannot** be empty.""" @@ -25,8 +27,7 @@ class CreateIpAccessList: * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block list. Exclude this IP or range. IP addresses in the block list are excluded even if they are included in an allow list.""" - ip_addresses: List[str] - """Array of IP addresses or CIDR values to be added to the IP access list.""" + ip_addresses: Optional[List[str]] = None def as_dict(self) -> dict: """Serializes the CreateIpAccessList into a dictionary suitable for use as a JSON request body.""" @@ -46,7 +47,10 @@ def from_dict(cls, d: Dict[str, any]) -> CreateIpAccessList: @dataclass class CreateIpAccessListResponse: + """An IP access list was successfully created.""" + ip_access_list: Optional[IpAccessListInfo] = None + """Definition of an IP Access list""" def as_dict(self) -> dict: """Serializes the CreateIpAccessListResponse into a dictionary suitable for use as a JSON request body.""" @@ -381,7 +385,10 @@ def from_dict(cls, d: Dict[str, any]) -> ExchangeTokenResponse: @dataclass class FetchIpAccessListResponse: + """An IP access list was successfully returned.""" + ip_access_list: Optional[IpAccessListInfo] = None + """Definition of an IP Access list""" def as_dict(self) -> dict: """Serializes the FetchIpAccessListResponse into a dictionary suitable for use as a JSON request body.""" @@ -398,6 +405,7 @@ def from_dict(cls, d: Dict[str, any]) -> FetchIpAccessListResponse: @dataclass class GetIpAccessListResponse: ip_access_list: Optional[IpAccessListInfo] = None + """Definition of an IP Access list""" def as_dict(self) -> dict: """Serializes the GetIpAccessListResponse into a dictionary suitable for use as a JSON request body.""" @@ -413,6 +421,8 @@ def from_dict(cls, d: Dict[str, any]) -> GetIpAccessListResponse: @dataclass class GetIpAccessListsResponse: + """IP access lists were successfully returned.""" + ip_access_lists: Optional[List[IpAccessListInfo]] = None def as_dict(self) -> dict: @@ -446,6 +456,8 @@ def from_dict(cls, d: Dict[str, any]) -> GetTokenPermissionLevelsResponse: @dataclass class IpAccessListInfo: + """Definition of an IP Access list""" + address_count: Optional[int] = None """Total number of IP or CIDR values.""" @@ -459,7 +471,6 @@ class IpAccessListInfo: """Specifies whether this IP access list is enabled.""" ip_addresses: Optional[List[str]] = None - """Array of IP addresses or CIDR values to be added to the IP access list.""" label: Optional[str] = None """Label for the IP access list. This **cannot** be empty.""" @@ -511,6 +522,8 @@ def from_dict(cls, d: Dict[str, any]) -> IpAccessListInfo: @dataclass class ListIpAccessListResponse: + """IP access lists were successfully returned.""" + ip_access_lists: Optional[List[IpAccessListInfo]] = None def as_dict(self) -> dict: @@ -970,6 +983,8 @@ def from_dict(cls, d: Dict[str, any]) -> PublicTokenInfo: @dataclass class ReplaceIpAccessList: + """Details required to replace an IP access list.""" + label: str """Label for the IP access list. This **cannot** be empty.""" @@ -979,17 +994,13 @@ class ReplaceIpAccessList: * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block list. Exclude this IP or range. IP addresses in the block list are excluded even if they are included in an allow list.""" - ip_addresses: List[str] - """Array of IP addresses or CIDR values to be added to the IP access list.""" - enabled: bool """Specifies whether this IP access list is enabled.""" ip_access_list_id: Optional[str] = None - """The ID for the corresponding IP access list to modify.""" + """The ID for the corresponding IP access list to modify""" - list_id: Optional[str] = None - """Universally unique identifier (UUID) of the IP access list.""" + ip_addresses: Optional[List[str]] = None def as_dict(self) -> dict: """Serializes the ReplaceIpAccessList into a dictionary suitable for use as a JSON request body.""" @@ -998,7 +1009,6 @@ def as_dict(self) -> dict: if self.ip_access_list_id is not None: body['ip_access_list_id'] = self.ip_access_list_id if self.ip_addresses: body['ip_addresses'] = [v for v in self.ip_addresses] if self.label is not None: body['label'] = self.label - if self.list_id is not None: body['list_id'] = self.list_id if self.list_type is not None: body['list_type'] = self.list_type.value return body @@ -1009,7 +1019,6 @@ def from_dict(cls, d: Dict[str, any]) -> ReplaceIpAccessList: ip_access_list_id=d.get('ip_access_list_id', None), ip_addresses=d.get('ip_addresses', None), label=d.get('label', None), - list_id=d.get('list_id', None), list_type=_enum(d, 'list_type', ListType)) @@ -1268,27 +1277,25 @@ class TokenType(Enum): @dataclass class UpdateIpAccessList: - label: str + """Details required to update an IP access list.""" + + enabled: Optional[bool] = None + """Specifies whether this IP access list is enabled.""" + + ip_access_list_id: Optional[str] = None + """The ID for the corresponding IP access list to modify""" + + ip_addresses: Optional[List[str]] = None + + label: Optional[str] = None """Label for the IP access list. This **cannot** be empty.""" - list_type: ListType + list_type: Optional[ListType] = None """Type of IP access list. Valid values are as follows and are case-sensitive: * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block list. Exclude this IP or range. IP addresses in the block list are excluded even if they are included in an allow list.""" - ip_addresses: List[str] - """Array of IP addresses or CIDR values to be added to the IP access list.""" - - enabled: bool - """Specifies whether this IP access list is enabled.""" - - ip_access_list_id: Optional[str] = None - """The ID for the corresponding IP access list to modify.""" - - list_id: Optional[str] = None - """Universally unique identifier (UUID) of the IP access list.""" - def as_dict(self) -> dict: """Serializes the UpdateIpAccessList into a dictionary suitable for use as a JSON request body.""" body = {} @@ -1296,7 +1303,6 @@ def as_dict(self) -> dict: if self.ip_access_list_id is not None: body['ip_access_list_id'] = self.ip_access_list_id if self.ip_addresses: body['ip_addresses'] = [v for v in self.ip_addresses] if self.label is not None: body['label'] = self.label - if self.list_id is not None: body['list_id'] = self.list_id if self.list_type is not None: body['list_type'] = self.list_type.value return body @@ -1307,7 +1313,6 @@ def from_dict(cls, d: Dict[str, any]) -> UpdateIpAccessList: ip_access_list_id=d.get('ip_access_list_id', None), ip_addresses=d.get('ip_addresses', None), label=d.get('label', None), - list_id=d.get('list_id', None), list_type=_enum(d, 'list_type', ListType)) @@ -1337,7 +1342,11 @@ class AccountIpAccessListsAPI: def __init__(self, api_client): self._api = api_client - def create(self, label: str, list_type: ListType, ip_addresses: List[str]) -> CreateIpAccessListResponse: + def create(self, + label: str, + list_type: ListType, + *, + ip_addresses: Optional[List[str]] = None) -> CreateIpAccessListResponse: """Create access list. Creates an IP access list for the account. @@ -1361,8 +1370,7 @@ def create(self, label: str, list_type: ListType, ip_addresses: List[str]) -> Cr * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block list. Exclude this IP or range. IP addresses in the block list are excluded even if they are included in an allow list. - :param ip_addresses: List[str] - Array of IP addresses or CIDR values to be added to the IP access list. + :param ip_addresses: List[str] (optional) :returns: :class:`CreateIpAccessListResponse` """ @@ -1383,12 +1391,11 @@ def delete(self, ip_access_list_id: str): Deletes an IP access list, specified by its list ID. :param ip_access_list_id: str - The ID for the corresponding IP access list. """ - headers = {} + headers = {'Accept': 'application/json', } self._api.do('DELETE', f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists/{ip_access_list_id}', headers=headers) @@ -1399,7 +1406,6 @@ def get(self, ip_access_list_id: str) -> GetIpAccessListResponse: Gets an IP access list, specified by its list ID. :param ip_access_list_id: str - The ID for the corresponding IP access list. :returns: :class:`GetIpAccessListResponse` """ @@ -1429,10 +1435,9 @@ def replace(self, ip_access_list_id: str, label: str, list_type: ListType, - ip_addresses: List[str], enabled: bool, *, - list_id: Optional[str] = None): + ip_addresses: Optional[List[str]] = None): """Replace access list. Replaces an IP access list, specified by its ID. @@ -1446,7 +1451,6 @@ def replace(self, effect. :param ip_access_list_id: str - The ID for the corresponding IP access list. :param label: str Label for the IP access list. This **cannot** be empty. :param list_type: :class:`ListType` @@ -1454,12 +1458,9 @@ def replace(self, * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block list. Exclude this IP or range. IP addresses in the block list are excluded even if they are included in an allow list. - :param ip_addresses: List[str] - Array of IP addresses or CIDR values to be added to the IP access list. :param enabled: bool Specifies whether this IP access list is enabled. - :param list_id: str (optional) - Universally unique identifier (UUID) of the IP access list. + :param ip_addresses: List[str] (optional) """ @@ -1467,7 +1468,6 @@ def replace(self, if enabled is not None: body['enabled'] = enabled if ip_addresses is not None: body['ip_addresses'] = [v for v in ip_addresses] if label is not None: body['label'] = label - if list_id is not None: body['list_id'] = list_id if list_type is not None: body['list_type'] = list_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } self._api.do('PUT', @@ -1477,12 +1477,11 @@ def replace(self, def update(self, ip_access_list_id: str, - label: str, - list_type: ListType, - ip_addresses: List[str], - enabled: bool, *, - list_id: Optional[str] = None): + enabled: Optional[bool] = None, + ip_addresses: Optional[List[str]] = None, + label: Optional[str] = None, + list_type: Optional[ListType] = None): """Update access list. Updates an existing IP access list, specified by its ID. @@ -1500,20 +1499,16 @@ def update(self, It can take a few minutes for the changes to take effect. :param ip_access_list_id: str - The ID for the corresponding IP access list. - :param label: str + :param enabled: bool (optional) + Specifies whether this IP access list is enabled. + :param ip_addresses: List[str] (optional) + :param label: str (optional) Label for the IP access list. This **cannot** be empty. - :param list_type: :class:`ListType` + :param list_type: :class:`ListType` (optional) Type of IP access list. Valid values are as follows and are case-sensitive: * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block list. Exclude this IP or range. IP addresses in the block list are excluded even if they are included in an allow list. - :param ip_addresses: List[str] - Array of IP addresses or CIDR values to be added to the IP access list. - :param enabled: bool - Specifies whether this IP access list is enabled. - :param list_id: str (optional) - Universally unique identifier (UUID) of the IP access list. """ @@ -1521,7 +1516,6 @@ def update(self, if enabled is not None: body['enabled'] = enabled if ip_addresses is not None: body['ip_addresses'] = [v for v in ip_addresses] if label is not None: body['label'] = label - if list_id is not None: body['list_id'] = list_id if list_type is not None: body['list_type'] = list_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } self._api.do('PATCH', @@ -1674,7 +1668,11 @@ class IpAccessListsAPI: def __init__(self, api_client): self._api = api_client - def create(self, label: str, list_type: ListType, ip_addresses: List[str]) -> CreateIpAccessListResponse: + def create(self, + label: str, + list_type: ListType, + *, + ip_addresses: Optional[List[str]] = None) -> CreateIpAccessListResponse: """Create access list. Creates an IP access list for this workspace. @@ -1699,8 +1697,7 @@ def create(self, label: str, list_type: ListType, ip_addresses: List[str]) -> Cr * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block list. Exclude this IP or range. IP addresses in the block list are excluded even if they are included in an allow list. - :param ip_addresses: List[str] - Array of IP addresses or CIDR values to be added to the IP access list. + :param ip_addresses: List[str] (optional) :returns: :class:`CreateIpAccessListResponse` """ @@ -1718,12 +1715,12 @@ def delete(self, ip_access_list_id: str): Deletes an IP access list, specified by its list ID. :param ip_access_list_id: str - The ID for the corresponding IP access list to modify. + The ID for the corresponding IP access list to modify """ - headers = {} + headers = {'Accept': 'application/json', } self._api.do('DELETE', f'/api/2.0/ip-access-lists/{ip_access_list_id}', headers=headers) def get(self, ip_access_list_id: str) -> FetchIpAccessListResponse: @@ -1732,7 +1729,7 @@ def get(self, ip_access_list_id: str) -> FetchIpAccessListResponse: Gets an IP access list, specified by its list ID. :param ip_access_list_id: str - The ID for the corresponding IP access list to modify. + The ID for the corresponding IP access list to modify :returns: :class:`FetchIpAccessListResponse` """ @@ -1758,10 +1755,9 @@ def replace(self, ip_access_list_id: str, label: str, list_type: ListType, - ip_addresses: List[str], enabled: bool, *, - list_id: Optional[str] = None): + ip_addresses: Optional[List[str]] = None): """Replace access list. Replaces an IP access list, specified by its ID. @@ -1776,7 +1772,7 @@ def replace(self, :method:workspaceconf/setStatus. :param ip_access_list_id: str - The ID for the corresponding IP access list to modify. + The ID for the corresponding IP access list to modify :param label: str Label for the IP access list. This **cannot** be empty. :param list_type: :class:`ListType` @@ -1784,12 +1780,9 @@ def replace(self, * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block list. Exclude this IP or range. IP addresses in the block list are excluded even if they are included in an allow list. - :param ip_addresses: List[str] - Array of IP addresses or CIDR values to be added to the IP access list. :param enabled: bool Specifies whether this IP access list is enabled. - :param list_id: str (optional) - Universally unique identifier (UUID) of the IP access list. + :param ip_addresses: List[str] (optional) """ @@ -1797,19 +1790,17 @@ def replace(self, if enabled is not None: body['enabled'] = enabled if ip_addresses is not None: body['ip_addresses'] = [v for v in ip_addresses] if label is not None: body['label'] = label - if list_id is not None: body['list_id'] = list_id if list_type is not None: body['list_type'] = list_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } self._api.do('PUT', f'/api/2.0/ip-access-lists/{ip_access_list_id}', body=body, headers=headers) def update(self, ip_access_list_id: str, - label: str, - list_type: ListType, - ip_addresses: List[str], - enabled: bool, *, - list_id: Optional[str] = None): + enabled: Optional[bool] = None, + ip_addresses: Optional[List[str]] = None, + label: Optional[str] = None, + list_type: Optional[ListType] = None): """Update access list. Updates an existing IP access list, specified by its ID. @@ -1828,20 +1819,17 @@ def update(self, no effect until you enable the feature. See :method:workspaceconf/setStatus. :param ip_access_list_id: str - The ID for the corresponding IP access list to modify. - :param label: str + The ID for the corresponding IP access list to modify + :param enabled: bool (optional) + Specifies whether this IP access list is enabled. + :param ip_addresses: List[str] (optional) + :param label: str (optional) Label for the IP access list. This **cannot** be empty. - :param list_type: :class:`ListType` + :param list_type: :class:`ListType` (optional) Type of IP access list. Valid values are as follows and are case-sensitive: * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block list. Exclude this IP or range. IP addresses in the block list are excluded even if they are included in an allow list. - :param ip_addresses: List[str] - Array of IP addresses or CIDR values to be added to the IP access list. - :param enabled: bool - Specifies whether this IP access list is enabled. - :param list_id: str (optional) - Universally unique identifier (UUID) of the IP access list. """ @@ -1849,7 +1837,6 @@ def update(self, if enabled is not None: body['enabled'] = enabled if ip_addresses is not None: body['ip_addresses'] = [v for v in ip_addresses] if label is not None: body['label'] = label - if list_id is not None: body['list_id'] = list_id if list_type is not None: body['list_type'] = list_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } self._api.do('PATCH', f'/api/2.0/ip-access-lists/{ip_access_list_id}', body=body, headers=headers) diff --git a/databricks/sdk/service/sql.py b/databricks/sdk/service/sql.py index 2b275a33d..3e3a60420 100755 --- a/databricks/sdk/service/sql.py +++ b/databricks/sdk/service/sql.py @@ -181,7 +181,10 @@ class AlertQuery: """The timestamp when this query was created.""" data_source_id: Optional[str] = None - """Data source ID.""" + """Data source ID maps to the ID of the data source used by the resource and is distinct from the + warehouse ID. [Learn more]. + + [Learn more]: https://docs.databricks.com/api/workspace/datasources/list""" description: Optional[str] = None """General description that conveys additional information about this query such as usage notes.""" @@ -343,6 +346,7 @@ def from_dict(cls, d: Dict[str, any]) -> ChannelInfo: class ChannelName(Enum): + """Name of the channel""" CHANNEL_NAME_CURRENT = 'CHANNEL_NAME_CURRENT' CHANNEL_NAME_CUSTOM = 'CHANNEL_NAME_CUSTOM' @@ -608,6 +612,7 @@ class CreateWidget: """Width of a widget""" id: Optional[str] = None + """Widget ID returned by :method:dashboardwidgets/create""" text: Optional[str] = None """If this is a textbox widget, the application displays this text. This field is ignored if the @@ -763,7 +768,10 @@ class DataSource: """A JSON object representing a DBSQL data source / SQL warehouse.""" id: Optional[str] = None - """Data source ID.""" + """Data source ID maps to the ID of the data source used by the resource and is distinct from the + warehouse ID. [Learn more]. + + [Learn more]: https://docs.databricks.com/api/workspace/datasources/list""" name: Optional[str] = None """The string name of this data source / SQL warehouse as it appears in the Databricks SQL web @@ -2045,7 +2053,10 @@ class Query: """The timestamp when this query was created.""" data_source_id: Optional[str] = None - """Data source ID.""" + """Data source ID maps to the ID of the data source used by the resource and is distinct from the + warehouse ID. [Learn more]. + + [Learn more]: https://docs.databricks.com/api/workspace/datasources/list""" description: Optional[str] = None """General description that conveys additional information about this query such as usage notes.""" @@ -2174,7 +2185,10 @@ def from_dict(cls, d: Dict[str, any]) -> Query: @dataclass class QueryEditContent: data_source_id: Optional[str] = None - """Data source ID.""" + """Data source ID maps to the ID of the data source used by the resource and is distinct from the + warehouse ID. [Learn more]. + + [Learn more]: https://docs.databricks.com/api/workspace/datasources/list""" description: Optional[str] = None """General description that conveys additional information about this query such as usage notes.""" @@ -2589,7 +2603,10 @@ def from_dict(cls, d: Dict[str, any]) -> QueryOptions: @dataclass class QueryPostContent: data_source_id: Optional[str] = None - """Data source ID.""" + """Data source ID maps to the ID of the data source used by the resource and is distinct from the + warehouse ID. [Learn more]. + + [Learn more]: https://docs.databricks.com/api/workspace/datasources/list""" description: Optional[str] = None """General description that conveys additional information about this query such as usage notes.""" @@ -3817,6 +3834,7 @@ def delete(self, id: str): """Remove widget. :param id: str + Widget ID returned by :method:dashboardwidgets/create """ @@ -3835,6 +3853,7 @@ def update(self, """Update existing widget. :param id: str + Widget ID returned by :method:dashboardwidgets/create :param dashboard_id: str Dashboard ID returned by :method:dashboards/create. :param options: :class:`WidgetOptions` @@ -4139,7 +4158,10 @@ def create(self, **Note**: You cannot add a visualization until you create the query. :param data_source_id: str (optional) - Data source ID. + Data source ID maps to the ID of the data source used by the resource and is distinct from the + warehouse ID. [Learn more]. + + [Learn more]: https://docs.databricks.com/api/workspace/datasources/list :param description: str (optional) General description that conveys additional information about this query such as usage notes. :param name: str (optional) @@ -4284,7 +4306,10 @@ def update(self, :param query_id: str :param data_source_id: str (optional) - Data source ID. + Data source ID maps to the ID of the data source used by the resource and is distinct from the + warehouse ID. [Learn more]. + + [Learn more]: https://docs.databricks.com/api/workspace/datasources/list :param description: str (optional) General description that conveys additional information about this query such as usage notes. :param name: str (optional) @@ -4401,6 +4426,7 @@ def delete(self, id: str): """Remove visualization. :param id: str + Widget ID returned by :method:queryvizualisations/create """ @@ -4541,6 +4567,8 @@ def cancel_execution(self, statement_id: str): state. :param statement_id: str + The statement ID is returned upon successfully submitting a SQL statement, and is a required + reference for all subsequent calls. """ @@ -4716,6 +4744,8 @@ def get_statement(self, statement_id: str) -> GetStatementResponse: **NOTE** This call currently might take up to 5 seconds to get the latest status and result. :param statement_id: str + The statement ID is returned upon successfully submitting a SQL statement, and is a required + reference for all subsequent calls. :returns: :class:`GetStatementResponse` """ @@ -4735,6 +4765,8 @@ def get_statement_result_chunk_n(self, statement_id: str, chunk_index: int) -> R `next_chunk_index` and `next_chunk_internal_link` fields for simple iteration through the result set. :param statement_id: str + The statement ID is returned upon successfully submitting a SQL statement, and is a required + reference for all subsequent calls. :param chunk_index: int :returns: :class:`ResultData` diff --git a/databricks/sdk/version.py b/databricks/sdk/version.py index a842d05a7..8911e95ca 100644 --- a/databricks/sdk/version.py +++ b/databricks/sdk/version.py @@ -1 +1 @@ -__version__ = '0.15.0' +__version__ = '0.16.0'