Skip to content

Commit b2d2299

Browse files
author
SDK Automation
committed
Generated from 252aae51d01c13bd9f5f3215a5770e7a2c9e6213
Update readme for onboard autorest.schema to sdkautomation
1 parent 44ed22a commit b2d2299

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+7731
-4089
lines changed

src/datashare/README.md

Lines changed: 5 additions & 201 deletions
Original file line numberDiff line numberDiff line change
@@ -1,201 +1,5 @@
1-
# Azure CLI datashare Extension #
2-
This package is for the 'datashare' extension, i.e. 'az datashare'. More info on what is [Data Share](https://docs.microsoft.com/azure/data-share/).
3-
4-
### How to use ###
5-
Install this extension using the below CLI command
6-
```
7-
az extension add --name datashare
8-
```
9-
10-
Register DataShare Resource Provider for your default susbcription.
11-
```
12-
az provider register -n "Microsoft.DataShare"
13-
```
14-
15-
### Included Features
16-
#### Datashare Account Management
17-
*Examples:*
18-
19-
##### Create a Datashare Account
20-
21-
```
22-
az datashare account create \
23-
--location "West US 2" \
24-
--tags tag1=Red tag2=White \
25-
--name "cli_test_account" \
26-
--resource-group "datashare_provider_rg"
27-
```
28-
29-
##### Wait for the Datashare Account to be provisioned
30-
```
31-
az datashare account wait \
32-
--name "cli_test_account" \
33-
--resource-group "datashare_provider_rg" \
34-
--created
35-
```
36-
37-
#### Datashare Resource Management for a Provider
38-
*Examples:*
39-
40-
##### Create a Datashare
41-
```
42-
az datashare create \
43-
--account-name "cli_test_account" \
44-
--resource-group "datashare_provider_rg" \
45-
--description "share description" \
46-
--share-kind "CopyBased" \
47-
--terms "Confidential" \
48-
--name "cli_test_share"
49-
```
50-
51-
##### Create a Data Set
52-
```
53-
az datashare dataset create \
54-
--account-name "cli_test_account" \
55-
--name "cli_test_data_set" \
56-
--resource-group "datashare_provider_rg" \
57-
--share-name "cli_test_share" \
58-
--dataset "{\"container_name\":\"mycontainer\",\"storage_account_name\":\"mysa\",\"kind\":\"Container\"}"
59-
```
60-
61-
Please make sure the datashare account has the right permission of the data source when creating a data set upon it.
62-
For instance, you can use `az datashare account show` to get 'identity.principalId' of the account, then assign the right role to it.
63-
```
64-
az role assignment create \
65-
--role "Storage Blob Data Reader" \
66-
--assignee-object-id {DatashareAccountPrincipalId} \
67-
--assignee-principal-type ServicePrincipal \
68-
--scope {StorageAccountId}
69-
```
70-
71-
##### Create a Synchronization Setting
72-
```
73-
az datashare synchronization-setting create \
74-
--account-name cli_test_account \
75-
--resource-group datashare_provider_rg \
76-
--share-name cli_test_share \
77-
--name cli_test_synchronization_setting \
78-
--recurrence-interval Day \
79-
--synchronization-time "2020-04-05 10:50:00 +00:00" \
80-
--kind ScheduleBased
81-
```
82-
83-
##### List Synchronization History
84-
```
85-
az datashare synchronization list \
86-
--account-name "cli_test_account" \
87-
--resource-group "datashare_provider_rg" \
88-
--share-name "cli_test_share"
89-
```
90-
91-
##### Create a Datashare Invitation
92-
```
93-
az datashare invitation create \
94-
--account-name "cli_test_account" \
95-
--target-email "[email protected]" \
96-
--name "cli_test_invitation" \
97-
--resource-group "datashare_provider_rg" \
98-
--share-name "cli_test_share"
99-
```
100-
101-
##### List Share Subscriptions
102-
```
103-
az datashare provider-share-subscription list \
104-
--account-name "cli_test_account" \
105-
--resource-group "datashare_provider_rg" \
106-
--share-name "cli_test_share"
107-
```
108-
Share subscriptions are created by Datashare consumers when they accept invitations.
109-
110-
##### Revoke Datashare for a Share Subscription
111-
```
112-
az datashare provider-share-subscription revoke \
113-
--account-name "cli_test_account" \
114-
--share-subscription "{ProviderShareSubscriptionObjectId}" \
115-
--resource-group "datashare_provider_rg" \
116-
--share-name "cli_test_share"
117-
```
118-
119-
##### Reinstate Datashare for a Share Subscription
120-
```
121-
az datashare provider-share-subscription reinstate \
122-
--account-name "cli_test_account" \
123-
--share-subscription "{ProviderShareSubscriptionObjectId}" \
124-
--resource-group "datashare_provider_rg" \
125-
--share-name "cli_test_share"
126-
```
127-
128-
#### Datashare Resource Management for a Consumer
129-
*Examples:*
130-
131-
##### List received Invitations
132-
```
133-
az datashare consumer invitation list
134-
```
135-
136-
##### Create a Share Subscription from an Invitation
137-
```
138-
az datashare consumer share-subscription create \
139-
--account-name "cli_test_consumer_account" \
140-
--resource-group "datashare_consumer_rg" \
141-
--invitation-id "{InvitationId1}" \
142-
--source-share-location "sourceShareLocation" \
143-
--name "cli_test_share_subscription"
144-
```
145-
146-
##### List Source Data Sets in the Share Subscription
147-
```
148-
az datashare consumer share-subscription list-source-dataset \
149-
--account-name "cli_test_consumer_account" \
150-
--resource-group "datashare_consumer_rg" \
151-
--share-subscription-name "cli_test_share_subscription"
152-
```
153-
154-
##### Create a Data Set Mapping of the Source Data Set
155-
```
156-
az datashare consumer dataset-mapping create \
157-
--account-name "cli_test_consumer_account" \
158-
--name "cli_test_data_set_mapping" \
159-
--resource-group "datashare_consumer_rg" \
160-
--share-subscription-name "cli_test_share_subscription" \
161-
--mapping "{\"data_set_id\":\"2036a39f-add6-4347-9c82-a424dfaf4e8d\", \
162-
\"container_name\":\"newcontainer\", \"storage_account_name\":\"consumersa\", \
163-
\"kind\":\"BlobFolder\",\"prefix\":\"myprefix\"}"
164-
```
165-
Please make sure the datashare consumer account has the right permission of the data target when creating a data set mapping on it. For instance, you can use `az datashare account show` to get 'identity.principalId' of the account, then assign the right role to it.
166-
```
167-
az role assignment create \
168-
--role "Storage Blob Data Contributor" \
169-
--assignee-object-id "{ConsumerDatashareAccountPrincipalId}" \
170-
--assignee-principal-type ServicePrincipal \
171-
--scope "{ConsumerStorageAccountId}"
172-
```
173-
174-
##### List the synchronization settings of the Source Datashare
175-
```
176-
az datashare consumer share-subscription list-source-share-synchronization-setting \
177-
--account-name "cli_test_consumer_account" \
178-
--resource-group "datashare_consumer_rg" \
179-
--share-subscription-name "cli_test_share_subscription"
180-
```
181-
182-
##### Create a trigger for the Share Subsciption
183-
```
184-
az datashare consumer trigger create \
185-
--account-name "cli_test_consumer_account" \
186-
--resource-group "datashare_consumer_rg" \
187-
--share-subscription-name "cli_test_share_subscription" \
188-
--name "cli_test_trigger" \
189-
--recurrence-interval Day \
190-
--synchronization-time "2020-04-05 10:50:00 +00:00" \
191-
--kind ScheduleBased
192-
```
193-
194-
##### Start a synchronization for the Share Subscription
195-
```
196-
az datashare consumer share-subscription synchronization start \
197-
--account-name "cli_test_consumer_account" \
198-
--resource-group "datashare_consumer_rg" \
199-
--share-subscription-name "cli_test_share_subscription" \
200-
--synchronization-mode "Incremental"
201-
```
1+
Microsoft Azure CLI 'datashare' Extension
2+
==========================================
3+
4+
This package is for the 'datashare' extension.
5+
i.e. 'az datashare'

src/datashare/azext_datashare/__init__.py

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
# --------------------------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# --------------------------------------------------------------------------------------------
5-
# pylint: disable=unused-argument
6-
# pylint: disable=unused-import
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
710

811
from azure.cli.core import AzCommandsLoader
9-
from azext_datashare._help import helps
12+
from azext_datashare.generated._help import helps # pylint: disable=unused-import
1013

1114

1215
class DataShareManagementClientCommandsLoader(AzCommandsLoader):
@@ -15,17 +18,14 @@ def __init__(self, cli_ctx=None):
1518
from azure.cli.core.commands import CliCommandType
1619
from azext_datashare.generated._client_factory import cf_datashare
1720
datashare_custom = CliCommandType(
18-
operations_tmpl='azext_datashare.manual.custom#{}', # modified
21+
operations_tmpl='azext_datashare.custom#{}',
1922
client_factory=cf_datashare)
20-
super(DataShareManagementClientCommandsLoader, self).__init__(cli_ctx=cli_ctx,
21-
custom_command_type=datashare_custom)
23+
parent = super(DataShareManagementClientCommandsLoader, self)
24+
parent.__init__(cli_ctx=cli_ctx, custom_command_type=datashare_custom)
2225

2326
def load_command_table(self, args):
24-
try:
25-
from azext_datashare.generated.commands import load_command_table
26-
load_command_table(self, args)
27-
except ImportError:
28-
pass
27+
from azext_datashare.generated.commands import load_command_table
28+
load_command_table(self, args)
2929
try:
3030
from azext_datashare.manual.commands import load_command_table as load_command_table_manual
3131
load_command_table_manual(self, args)
@@ -34,11 +34,8 @@ def load_command_table(self, args):
3434
return self.command_table
3535

3636
def load_arguments(self, command):
37-
try:
38-
from azext_datashare.generated._params import load_arguments
39-
load_arguments(self, command)
40-
except ImportError:
41-
pass
37+
from azext_datashare.generated._params import load_arguments
38+
load_arguments(self, command)
4239
try:
4340
from azext_datashare.manual._params import load_arguments as load_arguments_manual
4441
load_arguments_manual(self, command)

src/datashare/azext_datashare/_params.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/datashare/azext_datashare/action.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
# --------------------------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# --------------------------------------------------------------------------------------------
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
510
# pylint: disable=wildcard-import
611
# pylint: disable=unused-wildcard-import
712

8-
try:
9-
from .generated.action import * # noqa: F403
10-
except ImportError:
11-
pass
12-
13+
from .generated.action import * # noqa: F403
1314
try:
1415
from .manual.action import * # noqa: F403
1516
except ImportError:
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
# --------------------------------------------------------------------------------------------
2-
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# --------------------------------------------------------------------------------------------
5-
# pylint: disable=wildcard-import
6-
# pylint: disable=unused-wildcard-import
7-
8-
# try:
9-
# from .generated._help import * # noqa: F403
10-
# except ImportError:
11-
# pass
12-
13-
try:
14-
from .manual._help import * # noqa: F403
15-
except ImportError:
16-
pass
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
# pylint: disable=wildcard-import
11+
# pylint: disable=unused-wildcard-import
12+
13+
from .generated.custom import * # noqa: F403
14+
try:
15+
from .manual.custom import * # noqa: F403
16+
except ImportError:
17+
pass
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# coding=utf-8
2-
# --------------------------------------------------------------------------
3-
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# license information.
6-
#
7-
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
10-
# --------------------------------------------------------------------------
11-
12-
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

src/datashare/azext_datashare/generated/_client_factory.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
# --------------------------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# --------------------------------------------------------------------------------------------
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
510

611

712
def cf_datashare(cli_ctx, *_):

0 commit comments

Comments
 (0)