Skip to content

Commit

Permalink
[AutoRelease] t2-databricks-2023-06-14-29768(can only be merged by SD…
Browse files Browse the repository at this point in the history
…K owner) (Azure#30768)

* code and test

* update

* Update CHANGELOG.md

---------

Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
  • Loading branch information
3 people authored Jun 29, 2023
1 parent 23219e9 commit 892d560
Show file tree
Hide file tree
Showing 63 changed files with 818 additions and 1,014 deletions.
29 changes: 29 additions & 0 deletions sdk/databricks/azure-mgmt-databricks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Release History

## 2.0.0 (2023-06-29)

### Features Added

- Added operation group AccessConnectorsOperations
- Added operation group OutboundNetworkDependenciesEndpointsOperations
- Added operation group PrivateEndpointConnectionsOperations
- Added operation group PrivateLinkResourcesOperations
- Model OperationDisplay has a new parameter description
- Model Workspace has a new parameter disk_encryption_set_id
- Model Workspace has a new parameter encryption
- Model Workspace has a new parameter managed_disk_identity
- Model Workspace has a new parameter private_endpoint_connections
- Model Workspace has a new parameter public_network_access
- Model Workspace has a new parameter required_nsg_rules
- Model Workspace has a new parameter system_data
- Model WorkspaceCustomParameters has a new parameter load_balancer_backend_pool_name
- Model WorkspaceCustomParameters has a new parameter load_balancer_id
- Model WorkspaceCustomParameters has a new parameter nat_gateway_name
- Model WorkspaceCustomParameters has a new parameter public_ip_name
- Model WorkspaceCustomParameters has a new parameter resource_tags
- Model WorkspaceCustomParameters has a new parameter storage_account_name
- Model WorkspaceCustomParameters has a new parameter storage_account_sku_name
- Model WorkspaceCustomParameters has a new parameter vnet_address_prefix

### Breaking Changes

- Client name is changed from `DatabricksClient` to `AzureDatabricksManagementClient`

## 1.1.0b2 (2022-11-18)

### Features Added
Expand Down
50 changes: 43 additions & 7 deletions sdk/databricks/azure-mgmt-databricks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,53 @@ For a more complete view of Azure libraries, see the [azure sdk python release](

_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_

# Usage
## Getting started

### Prerequisites

To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)

For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
Code samples for this package can be found at [Data Bricks Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
- Python 3.7+ is required to use this package.
- [Azure subscription](https://azure.microsoft.com/free/)

### Install the package

# Provide Feedback
```bash
pip install azure-mgmt-databricks
pip install azure-identity
```

### Authentication

By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
- `AZURE_CLIENT_SECRET` for Azure client secret.

In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.

With above configuration, client can be authenticated by following code:

```python
from azure.identity import DefaultAzureCredential
from azure.mgmt.databricks import AzureDatabricksManagementClient
import os

sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
client = AzureDatabricksManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
```

## Examples

Code samples for this package can be found at:
- [Search Data Bricks Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)


## Troubleshooting

## Next steps

## Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in the
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
Expand Down
6 changes: 3 additions & 3 deletions sdk/databricks/azure-mgmt-databricks/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "171bef6183260f0ae968086596495813fcd29c4e",
"commit": "f36175f4c54eeec5b6d409406e131dadb540546a",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.2.7",
"@autorest/python@6.6.0",
"@autorest/modelerfour@4.24.3"
],
"autorest_command": "autorest specification/databricks/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/databricks/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.6.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/databricks/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@


class AzureDatabricksManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""The Microsoft Azure management APIs allow end users to operate on Azure Databricks Workspace
resources.
"""The Microsoft Azure management APIs allow end users to operate on Azure Databricks Workspace /
Access Connector resources.
:ivar workspaces: WorkspacesOperations operations
:vartype workspaces: azure.mgmt.databricks.operations.WorkspacesOperations
Expand All @@ -58,9 +58,6 @@ class AzureDatabricksManagementClient: # pylint: disable=client-accepts-api-ver
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-04-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""
Expand All @@ -75,7 +72,7 @@ def __init__(
self._config = AzureDatabricksManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
Expand Down Expand Up @@ -126,5 +123,5 @@ def __enter__(self) -> "AzureDatabricksManagementClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details) -> None:
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -15,11 +14,6 @@

from ._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
Expand All @@ -35,23 +29,17 @@ class AzureDatabricksManagementClientConfiguration(Configuration): # pylint: di
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-04-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(AzureDatabricksManagementClientConfiguration, self).__init__(**kwargs)
api_version: Literal["2022-04-01-preview"] = kwargs.pop("api_version", "2022-04-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")

self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-databricks/{}".format(VERSION))
self._configure(**kwargs)
Expand Down
Loading

0 comments on commit 892d560

Please sign in to comment.