Skip to content

Commit e5e27dc

Browse files
[azure-data-transfer] Adding new extension for azure-data-transfer and commands within the extension. (#8854)
* Adding azure data transfer commands * Taking review comments * Fixing build failures * Removing the duplicate name azure from the commands * Adding the read me file
1 parent 055522a commit e5e27dc

Some content is hidden

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

58 files changed

+19493
-0
lines changed

src/data-transfer/HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. :changelog:
2+
3+
Release History
4+
===============
5+
6+
1.0.0b1
7+
++++++
8+
* Initial release.

src/data-transfer/README.md

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
# Azure CLI automation Extension #
2+
This package is for the 'azure data transfer' extension, i.e. 'az data-transfer'.
3+
4+
### How to use ###
5+
Install this extension using the below CLI command
6+
```
7+
az extension add --name data-transfer
8+
```
9+
10+
### Included Features
11+
#### Viewing Pipelines:
12+
Manage Connection: [more info](https://learn.microsoft.com/en-us/azure/templates/microsoft.azuredatatransfer/pipelines/)\
13+
*Examples:*
14+
15+
##### Get a pipeline
16+
17+
```
18+
az data-transfer pipeline show \
19+
--resource-group groupName \
20+
--pipeline-name pipelineName
21+
22+
```
23+
##### List all pipelines in a subscription
24+
25+
```
26+
az data-transfer pipeline show --resource-group groupName
27+
28+
```
29+
30+
```
31+
az data-transfer pipeline show
32+
33+
```
34+
35+
##### Approve a connection in a pipeline
36+
37+
```
38+
az data-transfer pipeline approve-connection \
39+
--resource-group groupName \
40+
--pipeline-name pipelineName \
41+
--connection-id connectionResourceId
42+
43+
```
44+
45+
##### Reject a connection in a pipeline
46+
47+
```
48+
az data-transfer pipeline reject-connection \
49+
--resource-group groupName \
50+
--pipeline-name pipelineName \
51+
--connection-id connectionResourceId
52+
53+
```
54+
55+
#### Connection Management:
56+
Manage Connection: [more info](https://learn.microsoft.com/en-us/azure/templates/microsoft.azuredatatransfer/connections/)\
57+
*Examples:*
58+
59+
##### Create a receive side connection
60+
61+
```
62+
az data-transfer connection create \
63+
--resource-group groupName \
64+
--name connectionName \
65+
--location westus \
66+
--pipeline PipelineName \
67+
--direction Receive \
68+
--flow-types Api Data \
69+
--remote-subscription-id subscriptionId \
70+
--justification 'justification string' \
71+
--requirement-id 1234 \
72+
--primary-contact [email protected] \
73+
--secondary-contacts [email protected]
74+
75+
```
76+
##### Create a send side connection
77+
78+
```
79+
az data-transfer connection create \
80+
--resource-group groupName \
81+
--name connectionName \
82+
--location westus \
83+
--pipeline PipelineName \
84+
--direction Send \
85+
--flow-types Mission Data \
86+
--pin 123456\
87+
--primary-contact [email protected] \
88+
--secondary-contacts [email protected]
89+
90+
```
91+
92+
##### Link send and receive side connections
93+
94+
```
95+
az data-transfer connection link \
96+
--resource-group groupName \
97+
--name receiveSideConnectionName \
98+
--pending-connection-id sendSideResourceId
99+
100+
```
101+
102+
##### List connections in a resource group
103+
104+
```
105+
az data-transfer connection link \
106+
--resource-group groupName \
107+
--maxItems 10
108+
--nextToken <Link from previous response>
109+
110+
```
111+
112+
##### List pending connections that can be linked with the given connection
113+
114+
```
115+
az data-transfer connection list-pending-connection \
116+
--resource-group groupName \
117+
--name receiveSideConnectionName \
118+
--maxItems 10 \
119+
--nextToken <Link from previous response>
120+
121+
```
122+
123+
##### List pending flows in the given connection that are not linked
124+
125+
```
126+
az data-transfer connection list-pending-flow \
127+
--resource-group groupName \
128+
--connection-name receiveSideConnectionName \
129+
--maxItems 10 \
130+
--nextToken <Link from previous response>
131+
132+
```
133+
134+
##### Get the given connection
135+
136+
```
137+
az data-transfer connection show \
138+
--resource-group groupName \
139+
--connection-name connectionName
140+
141+
```
142+
143+
##### Update the given connection
144+
145+
Update of the tags is only supported.
146+
147+
```
148+
az data-transfer connection update \
149+
--resource-group groupName \
150+
--connection-name connectionName \
151+
--tags key1=update1
152+
153+
```
154+
155+
#### Flow Management:
156+
Manage Flow: [more info](https://learn.microsoft.com/en-us/azure/templates/microsoft.azuredatatransfer/connections/flows/)\
157+
*Examples:*
158+
159+
##### List flows in the given connection.
160+
161+
```
162+
az data-transfer connection list-pending-flow \
163+
--resource-group groupName \
164+
--connection-name receiveSideConnectionName \
165+
--maxItems 10 \
166+
--nextToken <Link from previous response>
167+
168+
```
169+
170+
##### Create a flow
171+
172+
```
173+
174+
az data-transfer connection flow create \
175+
--resource-group resourceGroupname \
176+
--connection-name connectionName \
177+
--name flowName \
178+
--flow-type "Mission" \
179+
--location eastus \
180+
--status "Enabled" \
181+
--storage-account strorageAccountResourceId \
182+
--storage-container-name testContainer \
183+
--data-type "Blob"
184+
185+
```
186+
187+
##### Link send and receive side flows
188+
189+
```
190+
az data-transfer connection link \
191+
--resource-group groupName \
192+
--connection-name receiveSideConnectionName \
193+
--name receiveSideFlowName \
194+
--pending-flow-id sendSideFlowResourceId
195+
196+
```
197+
198+
##### Get the given flow
199+
200+
```
201+
az data-transfer connection flow show \
202+
--resource-group groupName \
203+
--connection-name connectionName \
204+
--name flowName
205+
206+
```
207+
208+
##### Enable the given flow
209+
210+
```
211+
az data-transfer connection flow enable \
212+
--resource-group groupName \
213+
--connection-name connectionName \
214+
--name flowName
215+
216+
```
217+
218+
##### Disable the given flow
219+
220+
```
221+
az data-transfer connection flow disable \
222+
--resource-group groupName \
223+
--connection-name connectionName \
224+
--name flowName
225+
226+
```
227+
228+
##### Update the given flow
229+
230+
Update of the tags is only supported.
231+
232+
```
233+
az data-transfer connection flow update \
234+
--resource-group groupName \
235+
--connection-name connectionName \
236+
--flow-name flowName \
237+
--tags key1=update1
238+
239+
```
240+
241+
If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
from azure.cli.core import AzCommandsLoader
9+
from azext_data_transfer._help import helps # pylint: disable=unused-import
10+
11+
12+
class DataTransferCommandsLoader(AzCommandsLoader):
13+
14+
def __init__(self, cli_ctx=None):
15+
from azure.cli.core.commands import CliCommandType
16+
custom_command_type = CliCommandType(
17+
operations_tmpl='azext_data_transfer.custom#{}')
18+
super().__init__(cli_ctx=cli_ctx,
19+
custom_command_type=custom_command_type)
20+
21+
def load_command_table(self, args):
22+
from azext_data_transfer.commands import load_command_table
23+
from azure.cli.core.aaz import load_aaz_command_table
24+
try:
25+
from . import aaz
26+
except ImportError:
27+
aaz = None
28+
if aaz:
29+
load_aaz_command_table(
30+
loader=self,
31+
aaz_pkg_name=aaz.__name__,
32+
args=args
33+
)
34+
load_command_table(self, args)
35+
return self.command_table
36+
37+
def load_arguments(self, command):
38+
from azext_data_transfer._params import load_arguments
39+
load_arguments(self, command)
40+
41+
42+
COMMAND_LOADER_CLS = DataTransferCommandsLoader

0 commit comments

Comments
 (0)