pvw-cli 1.2.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pvw-cli might be problematic. Click here for more details.
- purviewcli/__init__.py +27 -0
- purviewcli/__main__.py +15 -0
- purviewcli/cli/__init__.py +5 -0
- purviewcli/cli/account.py +199 -0
- purviewcli/cli/cli.py +170 -0
- purviewcli/cli/collections.py +502 -0
- purviewcli/cli/domain.py +361 -0
- purviewcli/cli/entity.py +2436 -0
- purviewcli/cli/glossary.py +533 -0
- purviewcli/cli/health.py +250 -0
- purviewcli/cli/insight.py +113 -0
- purviewcli/cli/lineage.py +1103 -0
- purviewcli/cli/management.py +141 -0
- purviewcli/cli/policystore.py +103 -0
- purviewcli/cli/relationship.py +75 -0
- purviewcli/cli/scan.py +357 -0
- purviewcli/cli/search.py +527 -0
- purviewcli/cli/share.py +478 -0
- purviewcli/cli/types.py +831 -0
- purviewcli/cli/unified_catalog.py +3540 -0
- purviewcli/cli/workflow.py +402 -0
- purviewcli/client/__init__.py +21 -0
- purviewcli/client/_account.py +1877 -0
- purviewcli/client/_collections.py +1761 -0
- purviewcli/client/_domain.py +414 -0
- purviewcli/client/_entity.py +3545 -0
- purviewcli/client/_glossary.py +3233 -0
- purviewcli/client/_health.py +501 -0
- purviewcli/client/_insight.py +2873 -0
- purviewcli/client/_lineage.py +2138 -0
- purviewcli/client/_management.py +2202 -0
- purviewcli/client/_policystore.py +2915 -0
- purviewcli/client/_relationship.py +1351 -0
- purviewcli/client/_scan.py +2607 -0
- purviewcli/client/_search.py +1472 -0
- purviewcli/client/_share.py +272 -0
- purviewcli/client/_types.py +2708 -0
- purviewcli/client/_unified_catalog.py +5112 -0
- purviewcli/client/_workflow.py +2734 -0
- purviewcli/client/api_client.py +1295 -0
- purviewcli/client/business_rules.py +675 -0
- purviewcli/client/config.py +231 -0
- purviewcli/client/data_quality.py +433 -0
- purviewcli/client/endpoint.py +123 -0
- purviewcli/client/endpoints.py +554 -0
- purviewcli/client/exceptions.py +38 -0
- purviewcli/client/lineage_visualization.py +797 -0
- purviewcli/client/monitoring_dashboard.py +712 -0
- purviewcli/client/rate_limiter.py +30 -0
- purviewcli/client/retry_handler.py +125 -0
- purviewcli/client/scanning_operations.py +523 -0
- purviewcli/client/settings.py +1 -0
- purviewcli/client/sync_client.py +250 -0
- purviewcli/plugins/__init__.py +1 -0
- purviewcli/plugins/plugin_system.py +709 -0
- pvw_cli-1.2.8.dist-info/METADATA +1618 -0
- pvw_cli-1.2.8.dist-info/RECORD +60 -0
- pvw_cli-1.2.8.dist-info/WHEEL +5 -0
- pvw_cli-1.2.8.dist-info/entry_points.txt +3 -0
- pvw_cli-1.2.8.dist-info/top_level.txt +1 -0
purviewcli/cli/share.py
ADDED
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
"""
|
|
2
|
+
usage:
|
|
3
|
+
pvw share listAcceptedShares --sentShareName=<val> [--skipToken=<val>]
|
|
4
|
+
pvw share getAcceptedShare --sentShareName=<val> --acceptedSentShareName=<val>
|
|
5
|
+
pvw share reinstateAcceptedShare --sentShareName=<val> --acceptedSentShareName=<val> --payloadFile=<val>
|
|
6
|
+
pvw share revokeAcceptedShare --sentShareName=<val> --acceptedSentShareName=<val>
|
|
7
|
+
pvw share updateExpirationAcceptedShare --sentShareName=<val> --acceptedSentShareName=<val> --payloadFile=<val>
|
|
8
|
+
pvw share listAssetMappings --receivedShareName=<val> [--skipToken=<val> --filter=<val> --orderBy=<val>]
|
|
9
|
+
pvw share createAssetMapping --receivedShareName=<val> --assetMappingName=<val> --payloadFile=<val>
|
|
10
|
+
pvw share deleteAssetMapping --receivedShareName=<val> --assetMappingName=<val>
|
|
11
|
+
pvw share getAssetMapping --receivedShareName=<val> --assetMappingName=<val>
|
|
12
|
+
pvw share listAssets --sentShareName=<val> [--skipToken=<val> --filter=<val> --orderBy=<val>]
|
|
13
|
+
pvw share createAsset --sentShareName=<val> --assetName=<val> --payloadFile=<val>
|
|
14
|
+
pvw share deleteAsset --sentShareName=<val> --assetName=<val>
|
|
15
|
+
pvw share getAsset --sentShareName=<val> --assetName=<val>
|
|
16
|
+
pvw share activateEmail --payloadFile=<val>
|
|
17
|
+
pvw share registerEmail
|
|
18
|
+
pvw share listReceivedAssets --receivedShareName=<val> [--skipToken=<val>]
|
|
19
|
+
pvw share listReceivedInvitations [--skipToken=<val> --filter=<val> --orderBy=<val>]
|
|
20
|
+
pvw share getReceivedInvitation --invitationName=<val>
|
|
21
|
+
pvw share rejectReceivedInvitation --invitationName=<val> --payloadFile=<val>
|
|
22
|
+
pvw share listReceivedShares [--skipToken=<val> --filter=<val> --orderBy=<val>]
|
|
23
|
+
pvw share createReceivedShare --receivedShareName=<val> --payloadFile=<val>
|
|
24
|
+
pvw share deleteReceivedShare --receivedShareName=<val>
|
|
25
|
+
pvw share getReceivedShare --receivedShareName=<val>
|
|
26
|
+
pvw share listSentInvitations --sentShareName=<val> [--skipToken=<val> --filter=<val> --orderBy=<val>]
|
|
27
|
+
pvw share createSentInvitation --sentShareName=<val> --invitationName=<val> --payloadFile=<val>
|
|
28
|
+
pvw share deleteSentInvitation --sentShareName=<val> --invitationName=<val>
|
|
29
|
+
pvw share getSentInvitation --sentShareName=<val> --invitationName=<val>
|
|
30
|
+
pvw share listSentShares [--skipToken=<val> --filter=<val> --orderBy=<val>]
|
|
31
|
+
pvw share createSentShare --sentShareName=<val> --payloadFile=<val>
|
|
32
|
+
pvw share deleteSentShare --sentShareName=<val>
|
|
33
|
+
pvw share getSentShare --sentShareName=<val>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
options:
|
|
37
|
+
--purviewName=<val> [string] The name of the Microsoft Purview account.
|
|
38
|
+
--receivedShareName=<val> [string] The name of the received share.
|
|
39
|
+
--sentShareName=<val> [string] The name of the sent share.
|
|
40
|
+
--acceptedSentShareName=<val> [string] The name of the accepted sent share.
|
|
41
|
+
--assetMappingName=<val> [string] The name of the asset mapping.
|
|
42
|
+
--assetName=<val> [string] The name of the asset.
|
|
43
|
+
--invitationName=<val> [string] The name of the invitation.
|
|
44
|
+
--skipToken=<val> [string] The continuation token to list the next page.
|
|
45
|
+
--filter=<val> [string] Filters the results using OData syntax.
|
|
46
|
+
--orderBy=<val> [string] Sorts the results using OData syntax.
|
|
47
|
+
--payloadFile=<val> [string] File path to a valid JSON document.
|
|
48
|
+
|
|
49
|
+
"""
|
|
50
|
+
import json
|
|
51
|
+
import click
|
|
52
|
+
from purviewcli.client._share import Share
|
|
53
|
+
|
|
54
|
+
@click.group()
|
|
55
|
+
def share():
|
|
56
|
+
"""Manage data sharing in Microsoft Purview.
|
|
57
|
+
"""
|
|
58
|
+
pass
|
|
59
|
+
|
|
60
|
+
# Accepted Sent Shares
|
|
61
|
+
@share.command(name="list-accepted-shares")
|
|
62
|
+
@click.option('--sent-share-name', required=True, help='The name of the sent share')
|
|
63
|
+
@click.option('--skip-token', required=False, help='Continuation token for paging')
|
|
64
|
+
def list_accepted_shares(sent_share_name, skip_token):
|
|
65
|
+
"""List accepted shares for a sent share"""
|
|
66
|
+
try:
|
|
67
|
+
args = {'--sentShareName': sent_share_name, '--skipToken': skip_token}
|
|
68
|
+
client = Share()
|
|
69
|
+
result = client.shareListAcceptedShares(args)
|
|
70
|
+
click.echo(json.dumps(result, indent=2))
|
|
71
|
+
except Exception as e:
|
|
72
|
+
click.echo(f"Error: {e}")
|
|
73
|
+
|
|
74
|
+
@share.command(name="get-accepted-share")
|
|
75
|
+
@click.option('--sent-share-name', required=True, help='The name of the sent share')
|
|
76
|
+
@click.option('--accepted-sent-share-name', required=True, help='The name of the accepted sent share')
|
|
77
|
+
def get_accepted_share(sent_share_name, accepted_sent_share_name):
|
|
78
|
+
"""Get an accepted share by name"""
|
|
79
|
+
try:
|
|
80
|
+
args = {'--sentShareName': sent_share_name, '--acceptedSentShareName': accepted_sent_share_name}
|
|
81
|
+
client = Share()
|
|
82
|
+
result = client.shareGetAcceptedShare(args)
|
|
83
|
+
click.echo(json.dumps(result, indent=2))
|
|
84
|
+
except Exception as e:
|
|
85
|
+
click.echo(f"Error: {e}")
|
|
86
|
+
|
|
87
|
+
@share.command(name="reinstate-accepted-share")
|
|
88
|
+
@click.option('--sent-share-name', required=True)
|
|
89
|
+
@click.option('--accepted-sent-share-name', required=True)
|
|
90
|
+
@click.option('--payload-file', type=click.Path(exists=True), required=True)
|
|
91
|
+
def reinstate_accepted_share(sent_share_name, accepted_sent_share_name, payload_file):
|
|
92
|
+
"""Reinstate an accepted share"""
|
|
93
|
+
try:
|
|
94
|
+
args = {'--sentShareName': sent_share_name, '--acceptedSentShareName': accepted_sent_share_name, '--payloadFile': payload_file}
|
|
95
|
+
client = Share()
|
|
96
|
+
result = client.shareReinstateAcceptedShare(args)
|
|
97
|
+
click.echo(json.dumps(result, indent=2))
|
|
98
|
+
except Exception as e:
|
|
99
|
+
click.echo(f"Error: {e}")
|
|
100
|
+
|
|
101
|
+
@share.command(name="revoke-accepted-share")
|
|
102
|
+
@click.option('--sent-share-name', required=True)
|
|
103
|
+
@click.option('--accepted-sent-share-name', required=True)
|
|
104
|
+
def revoke_accepted_share(sent_share_name, accepted_sent_share_name):
|
|
105
|
+
"""Revoke an accepted share"""
|
|
106
|
+
try:
|
|
107
|
+
args = {'--sentShareName': sent_share_name, '--acceptedSentShareName': accepted_sent_share_name}
|
|
108
|
+
client = Share()
|
|
109
|
+
result = client.shareRevokeAcceptedShare(args)
|
|
110
|
+
click.echo(json.dumps(result, indent=2))
|
|
111
|
+
except Exception as e:
|
|
112
|
+
click.echo(f"Error: {e}")
|
|
113
|
+
|
|
114
|
+
@share.command(name="update-expiration-accepted-share")
|
|
115
|
+
@click.option('--sent-share-name', required=True)
|
|
116
|
+
@click.option('--accepted-sent-share-name', required=True)
|
|
117
|
+
@click.option('--payload-file', type=click.Path(exists=True), required=True)
|
|
118
|
+
def update_expiration_accepted_share(sent_share_name, accepted_sent_share_name, payload_file):
|
|
119
|
+
"""Update expiration for an accepted share"""
|
|
120
|
+
try:
|
|
121
|
+
args = {'--sentShareName': sent_share_name, '--acceptedSentShareName': accepted_sent_share_name, '--payloadFile': payload_file}
|
|
122
|
+
client = Share()
|
|
123
|
+
result = client.shareUpdateExpirationAcceptedShare(args)
|
|
124
|
+
click.echo(json.dumps(result, indent=2))
|
|
125
|
+
except Exception as e:
|
|
126
|
+
click.echo(f"Error: {e}")
|
|
127
|
+
|
|
128
|
+
# Asset Mappings
|
|
129
|
+
@share.command(name="list-asset-mappings")
|
|
130
|
+
@click.option('--received-share-name', required=True)
|
|
131
|
+
@click.option('--skip-token', required=False)
|
|
132
|
+
@click.option('--filter', required=False)
|
|
133
|
+
@click.option('--order-by', required=False)
|
|
134
|
+
def list_asset_mappings(received_share_name, skip_token, filter, order_by):
|
|
135
|
+
"""List asset mappings for a received share"""
|
|
136
|
+
try:
|
|
137
|
+
args = {'--receivedShareName': received_share_name, '--skipToken': skip_token, '--filter': filter, '--orderBy': order_by}
|
|
138
|
+
client = Share()
|
|
139
|
+
result = client.shareListAssetMappings(args)
|
|
140
|
+
click.echo(json.dumps(result, indent=2))
|
|
141
|
+
except Exception as e:
|
|
142
|
+
click.echo(f"Error: {e}")
|
|
143
|
+
|
|
144
|
+
@share.command(name="create-asset-mapping")
|
|
145
|
+
@click.option('--received-share-name', required=True)
|
|
146
|
+
@click.option('--asset-mapping-name', required=True)
|
|
147
|
+
@click.option('--payload-file', type=click.Path(exists=True), required=True)
|
|
148
|
+
def create_asset_mapping(received_share_name, asset_mapping_name, payload_file):
|
|
149
|
+
"""Create an asset mapping for a received share"""
|
|
150
|
+
try:
|
|
151
|
+
args = {'--receivedShareName': received_share_name, '--assetMappingName': asset_mapping_name, '--payloadFile': payload_file}
|
|
152
|
+
client = Share()
|
|
153
|
+
result = client.shareCreateAssetMapping(args)
|
|
154
|
+
click.echo(json.dumps(result, indent=2))
|
|
155
|
+
except Exception as e:
|
|
156
|
+
click.echo(f"Error: {e}")
|
|
157
|
+
|
|
158
|
+
@share.command()
|
|
159
|
+
@click.option('--received-share-name', required=True)
|
|
160
|
+
@click.option('--asset-mapping-name', required=True)
|
|
161
|
+
def delete_asset_mapping(received_share_name, asset_mapping_name):
|
|
162
|
+
"""Delete an asset mapping for a received share"""
|
|
163
|
+
try:
|
|
164
|
+
args = {'--receivedShareName': received_share_name, '--assetMappingName': asset_mapping_name}
|
|
165
|
+
client = Share()
|
|
166
|
+
result = client.shareDeleteAssetMapping(args)
|
|
167
|
+
click.echo(json.dumps(result, indent=2))
|
|
168
|
+
except Exception as e:
|
|
169
|
+
click.echo(f"Error: {e}")
|
|
170
|
+
|
|
171
|
+
@share.command()
|
|
172
|
+
@click.option('--received-share-name', required=True)
|
|
173
|
+
@click.option('--asset-mapping-name', required=True)
|
|
174
|
+
def get_asset_mapping(received_share_name, asset_mapping_name):
|
|
175
|
+
"""Get an asset mapping for a received share"""
|
|
176
|
+
try:
|
|
177
|
+
args = {'--receivedShareName': received_share_name, '--assetMappingName': asset_mapping_name}
|
|
178
|
+
client = Share()
|
|
179
|
+
result = client.shareGetAssetMapping(args)
|
|
180
|
+
click.echo(json.dumps(result, indent=2))
|
|
181
|
+
except Exception as e:
|
|
182
|
+
click.echo(f"Error: {e}")
|
|
183
|
+
|
|
184
|
+
# Assets
|
|
185
|
+
@share.command()
|
|
186
|
+
@click.option('--sent-share-name', required=True)
|
|
187
|
+
@click.option('--skip-token', required=False)
|
|
188
|
+
@click.option('--filter', required=False)
|
|
189
|
+
@click.option('--order-by', required=False)
|
|
190
|
+
def list_assets(sent_share_name, skip_token, filter, order_by):
|
|
191
|
+
"""List assets for a sent share"""
|
|
192
|
+
try:
|
|
193
|
+
args = {'--sentShareName': sent_share_name, '--skipToken': skip_token, '--filter': filter, '--orderBy': order_by}
|
|
194
|
+
client = Share()
|
|
195
|
+
result = client.shareListAssets(args)
|
|
196
|
+
click.echo(json.dumps(result, indent=2))
|
|
197
|
+
except Exception as e:
|
|
198
|
+
click.echo(f"Error: {e}")
|
|
199
|
+
|
|
200
|
+
@share.command()
|
|
201
|
+
@click.option('--sent-share-name', required=True)
|
|
202
|
+
@click.option('--asset-name', required=True)
|
|
203
|
+
@click.option('--payload-file', type=click.Path(exists=True), required=True)
|
|
204
|
+
def create_asset(sent_share_name, asset_name, payload_file):
|
|
205
|
+
"""Create an asset for a sent share"""
|
|
206
|
+
try:
|
|
207
|
+
args = {'--sentShareName': sent_share_name, '--assetName': asset_name, '--payloadFile': payload_file}
|
|
208
|
+
client = Share()
|
|
209
|
+
result = client.shareCreateAsset(args)
|
|
210
|
+
click.echo(json.dumps(result, indent=2))
|
|
211
|
+
except Exception as e:
|
|
212
|
+
click.echo(f"Error: {e}")
|
|
213
|
+
|
|
214
|
+
@share.command()
|
|
215
|
+
@click.option('--sent-share-name', required=True)
|
|
216
|
+
@click.option('--asset-name', required=True)
|
|
217
|
+
def delete_asset(sent_share_name, asset_name):
|
|
218
|
+
"""Delete an asset for a sent share"""
|
|
219
|
+
try:
|
|
220
|
+
args = {'--sentShareName': sent_share_name, '--assetName': asset_name}
|
|
221
|
+
client = Share()
|
|
222
|
+
result = client.shareDeleteAsset(args)
|
|
223
|
+
click.echo(json.dumps(result, indent=2))
|
|
224
|
+
except Exception as e:
|
|
225
|
+
click.echo(f"Error: {e}")
|
|
226
|
+
|
|
227
|
+
@share.command()
|
|
228
|
+
@click.option('--sent-share-name', required=True)
|
|
229
|
+
@click.option('--asset-name', required=True)
|
|
230
|
+
def get_asset(sent_share_name, asset_name):
|
|
231
|
+
"""Get an asset for a sent share"""
|
|
232
|
+
try:
|
|
233
|
+
args = {'--sentShareName': sent_share_name, '--assetName': asset_name}
|
|
234
|
+
client = Share()
|
|
235
|
+
result = client.shareGetAsset(args)
|
|
236
|
+
click.echo(json.dumps(result, indent=2))
|
|
237
|
+
except Exception as e:
|
|
238
|
+
click.echo(f"Error: {e}")
|
|
239
|
+
|
|
240
|
+
# Email
|
|
241
|
+
@share.command()
|
|
242
|
+
@click.option('--payload-file', type=click.Path(exists=True), required=True)
|
|
243
|
+
def activate_email(payload_file):
|
|
244
|
+
"""Activate email for data sharing"""
|
|
245
|
+
try:
|
|
246
|
+
args = {'--payloadFile': payload_file}
|
|
247
|
+
client = Share()
|
|
248
|
+
result = client.shareActivateEmail(args)
|
|
249
|
+
click.echo(json.dumps(result, indent=2))
|
|
250
|
+
except Exception as e:
|
|
251
|
+
click.echo(f"Error: {e}")
|
|
252
|
+
|
|
253
|
+
@share.command()
|
|
254
|
+
def register_email():
|
|
255
|
+
"""Register email for data sharing"""
|
|
256
|
+
try:
|
|
257
|
+
args = {}
|
|
258
|
+
client = Share()
|
|
259
|
+
result = client.shareRegisterEmail(args)
|
|
260
|
+
click.echo(json.dumps(result, indent=2))
|
|
261
|
+
except Exception as e:
|
|
262
|
+
click.echo(f"Error: {e}")
|
|
263
|
+
|
|
264
|
+
# Received Assets
|
|
265
|
+
@share.command()
|
|
266
|
+
@click.option('--received-share-name', required=True)
|
|
267
|
+
@click.option('--skip-token', required=False)
|
|
268
|
+
def list_received_assets(received_share_name, skip_token):
|
|
269
|
+
"""List received assets for a received share"""
|
|
270
|
+
try:
|
|
271
|
+
args = {'--receivedShareName': received_share_name, '--skipToken': skip_token}
|
|
272
|
+
client = Share()
|
|
273
|
+
result = client.shareListReceivedAssets(args)
|
|
274
|
+
click.echo(json.dumps(result, indent=2))
|
|
275
|
+
except Exception as e:
|
|
276
|
+
click.echo(f"Error: {e}")
|
|
277
|
+
|
|
278
|
+
# Received Invitations
|
|
279
|
+
@share.command()
|
|
280
|
+
@click.option('--skip-token', required=False)
|
|
281
|
+
@click.option('--filter', required=False)
|
|
282
|
+
@click.option('--order-by', required=False)
|
|
283
|
+
def list_received_invitations(skip_token, filter, order_by):
|
|
284
|
+
"""List received invitations"""
|
|
285
|
+
try:
|
|
286
|
+
args = {'--skipToken': skip_token, '--filter': filter, '--orderBy': order_by}
|
|
287
|
+
client = Share()
|
|
288
|
+
result = client.shareListReceivedInvitations(args)
|
|
289
|
+
click.echo(json.dumps(result, indent=2))
|
|
290
|
+
except Exception as e:
|
|
291
|
+
click.echo(f"Error: {e}")
|
|
292
|
+
|
|
293
|
+
@share.command()
|
|
294
|
+
@click.option('--invitation-name', required=True)
|
|
295
|
+
def get_received_invitation(invitation_name):
|
|
296
|
+
"""Get a received invitation by name"""
|
|
297
|
+
try:
|
|
298
|
+
args = {'--invitationName': invitation_name}
|
|
299
|
+
client = Share()
|
|
300
|
+
result = client.shareGetReceivedInvitation(args)
|
|
301
|
+
click.echo(json.dumps(result, indent=2))
|
|
302
|
+
except Exception as e:
|
|
303
|
+
click.echo(f"Error: {e}")
|
|
304
|
+
|
|
305
|
+
@share.command()
|
|
306
|
+
@click.option('--invitation-name', required=True)
|
|
307
|
+
@click.option('--payload-file', type=click.Path(exists=True), required=True)
|
|
308
|
+
def reject_received_invitation(invitation_name, payload_file):
|
|
309
|
+
"""Reject a received invitation"""
|
|
310
|
+
try:
|
|
311
|
+
args = {'--invitationName': invitation_name, '--payloadFile': payload_file}
|
|
312
|
+
client = Share()
|
|
313
|
+
result = client.shareRejectReceivedInvitation(args)
|
|
314
|
+
click.echo(json.dumps(result, indent=2))
|
|
315
|
+
except Exception as e:
|
|
316
|
+
click.echo(f"Error: {e}")
|
|
317
|
+
|
|
318
|
+
# Received Shares
|
|
319
|
+
@share.command()
|
|
320
|
+
@click.option('--skip-token', required=False)
|
|
321
|
+
@click.option('--filter', required=False)
|
|
322
|
+
@click.option('--order-by', required=False)
|
|
323
|
+
def list_received_shares(skip_token, filter, order_by):
|
|
324
|
+
"""List received shares"""
|
|
325
|
+
try:
|
|
326
|
+
args = {'--skipToken': skip_token, '--filter': filter, '--orderBy': order_by}
|
|
327
|
+
client = Share()
|
|
328
|
+
result = client.shareListReceivedShares(args)
|
|
329
|
+
click.echo(json.dumps(result, indent=2))
|
|
330
|
+
except Exception as e:
|
|
331
|
+
click.echo(f"Error: {e}")
|
|
332
|
+
|
|
333
|
+
@share.command()
|
|
334
|
+
@click.option('--received-share-name', required=True)
|
|
335
|
+
@click.option('--payload-file', type=click.Path(exists=True), required=True)
|
|
336
|
+
def create_received_share(received_share_name, payload_file):
|
|
337
|
+
"""Create a received share"""
|
|
338
|
+
try:
|
|
339
|
+
args = {'--receivedShareName': received_share_name, '--payloadFile': payload_file}
|
|
340
|
+
client = Share()
|
|
341
|
+
result = client.shareCreateReceivedShare(args)
|
|
342
|
+
click.echo(json.dumps(result, indent=2))
|
|
343
|
+
except Exception as e:
|
|
344
|
+
click.echo(f"Error: {e}")
|
|
345
|
+
|
|
346
|
+
@share.command()
|
|
347
|
+
@click.option('--received-share-name', required=True)
|
|
348
|
+
def delete_received_share(received_share_name):
|
|
349
|
+
"""Delete a received share"""
|
|
350
|
+
try:
|
|
351
|
+
args = {'--receivedShareName': received_share_name}
|
|
352
|
+
client = Share()
|
|
353
|
+
result = client.shareDeleteReceivedShare(args)
|
|
354
|
+
click.echo(json.dumps(result, indent=2))
|
|
355
|
+
except Exception as e:
|
|
356
|
+
click.echo(f"Error: {e}")
|
|
357
|
+
|
|
358
|
+
@share.command()
|
|
359
|
+
@click.option('--received-share-name', required=True)
|
|
360
|
+
def get_received_share(received_share_name):
|
|
361
|
+
"""Get a received share by name"""
|
|
362
|
+
try:
|
|
363
|
+
args = {'--receivedShareName': received_share_name}
|
|
364
|
+
client = Share()
|
|
365
|
+
result = client.shareGetReceivedShare(args)
|
|
366
|
+
click.echo(json.dumps(result, indent=2))
|
|
367
|
+
except Exception as e:
|
|
368
|
+
click.echo(f"Error: {e}")
|
|
369
|
+
|
|
370
|
+
# Sent Invitations
|
|
371
|
+
@share.command()
|
|
372
|
+
@click.option('--sent-share-name', required=True)
|
|
373
|
+
@click.option('--skip-token', required=False)
|
|
374
|
+
@click.option('--filter', required=False)
|
|
375
|
+
@click.option('--order-by', required=False)
|
|
376
|
+
def list_sent_invitations(sent_share_name, skip_token, filter, order_by):
|
|
377
|
+
"""List sent invitations for a sent share"""
|
|
378
|
+
try:
|
|
379
|
+
args = {'--sentShareName': sent_share_name, '--skipToken': skip_token, '--filter': filter, '--orderBy': order_by}
|
|
380
|
+
client = Share()
|
|
381
|
+
result = client.shareListSentInvitations(args)
|
|
382
|
+
click.echo(json.dumps(result, indent=2))
|
|
383
|
+
except Exception as e:
|
|
384
|
+
click.echo(f"Error: {e}")
|
|
385
|
+
|
|
386
|
+
@share.command()
|
|
387
|
+
@click.option('--sent-share-name', required=True)
|
|
388
|
+
@click.option('--invitation-name', required=True)
|
|
389
|
+
@click.option('--payload-file', type=click.Path(exists=True), required=True)
|
|
390
|
+
def create_sent_invitation(sent_share_name, invitation_name, payload_file):
|
|
391
|
+
"""Create a sent invitation for a sent share"""
|
|
392
|
+
try:
|
|
393
|
+
args = {'--sentShareName': sent_share_name, '--invitationName': invitation_name, '--payloadFile': payload_file}
|
|
394
|
+
client = Share()
|
|
395
|
+
result = client.shareCreateSentInvitation(args)
|
|
396
|
+
click.echo(json.dumps(result, indent=2))
|
|
397
|
+
except Exception as e:
|
|
398
|
+
click.echo(f"Error: {e}")
|
|
399
|
+
|
|
400
|
+
@share.command()
|
|
401
|
+
@click.option('--sent-share-name', required=True)
|
|
402
|
+
@click.option('--invitation-name', required=True)
|
|
403
|
+
def delete_sent_invitation(sent_share_name, invitation_name):
|
|
404
|
+
"""Delete a sent invitation for a sent share"""
|
|
405
|
+
try:
|
|
406
|
+
args = {'--sentShareName': sent_share_name, '--invitationName': invitation_name}
|
|
407
|
+
client = Share()
|
|
408
|
+
result = client.shareDeleteSentInvitation(args)
|
|
409
|
+
click.echo(json.dumps(result, indent=2))
|
|
410
|
+
except Exception as e:
|
|
411
|
+
click.echo(f"Error: {e}")
|
|
412
|
+
|
|
413
|
+
@share.command()
|
|
414
|
+
@click.option('--sent-share-name', required=True)
|
|
415
|
+
@click.option('--invitation-name', required=True)
|
|
416
|
+
def get_sent_invitation(sent_share_name, invitation_name):
|
|
417
|
+
"""Get a sent invitation for a sent share"""
|
|
418
|
+
try:
|
|
419
|
+
args = {'--sentShareName': sent_share_name, '--invitationName': invitation_name}
|
|
420
|
+
client = Share()
|
|
421
|
+
result = client.shareGetSentInvitation(args)
|
|
422
|
+
click.echo(json.dumps(result, indent=2))
|
|
423
|
+
except Exception as e:
|
|
424
|
+
click.echo(f"Error: {e}")
|
|
425
|
+
|
|
426
|
+
# Sent Shares
|
|
427
|
+
@share.command()
|
|
428
|
+
@click.option('--skip-token', required=False)
|
|
429
|
+
@click.option('--filter', required=False)
|
|
430
|
+
@click.option('--order-by', required=False)
|
|
431
|
+
def list_sent_shares(skip_token, filter, order_by):
|
|
432
|
+
"""List sent shares"""
|
|
433
|
+
try:
|
|
434
|
+
args = {'--skipToken': skip_token, '--filter': filter, '--orderBy': order_by}
|
|
435
|
+
client = Share()
|
|
436
|
+
result = client.shareListSentShares(args)
|
|
437
|
+
click.echo(json.dumps(result, indent=2))
|
|
438
|
+
except Exception as e:
|
|
439
|
+
click.echo(f"Error: {e}")
|
|
440
|
+
|
|
441
|
+
@share.command()
|
|
442
|
+
@click.option('--sent-share-name', required=True)
|
|
443
|
+
@click.option('--payload-file', type=click.Path(exists=True), required=True)
|
|
444
|
+
def create_sent_share(sent_share_name, payload_file):
|
|
445
|
+
"""Create a sent share"""
|
|
446
|
+
try:
|
|
447
|
+
args = {'--sentShareName': sent_share_name, '--payloadFile': payload_file}
|
|
448
|
+
client = Share()
|
|
449
|
+
result = client.shareCreateSentShare(args)
|
|
450
|
+
click.echo(json.dumps(result, indent=2))
|
|
451
|
+
except Exception as e:
|
|
452
|
+
click.echo(f"Error: {e}")
|
|
453
|
+
|
|
454
|
+
@share.command()
|
|
455
|
+
@click.option('--sent-share-name', required=True)
|
|
456
|
+
def delete_sent_share(sent_share_name):
|
|
457
|
+
"""Delete a sent share"""
|
|
458
|
+
try:
|
|
459
|
+
args = {'--sentShareName': sent_share_name}
|
|
460
|
+
client = Share()
|
|
461
|
+
result = client.shareDeleteSentShare(args)
|
|
462
|
+
click.echo(json.dumps(result, indent=2))
|
|
463
|
+
except Exception as e:
|
|
464
|
+
click.echo(f"Error: {e}")
|
|
465
|
+
|
|
466
|
+
@share.command()
|
|
467
|
+
@click.option('--sent-share-name', required=True)
|
|
468
|
+
def get_sent_share(sent_share_name):
|
|
469
|
+
"""Get a sent share by name"""
|
|
470
|
+
try:
|
|
471
|
+
args = {'--sentShareName': sent_share_name}
|
|
472
|
+
client = Share()
|
|
473
|
+
result = client.shareGetSentShare(args)
|
|
474
|
+
click.echo(json.dumps(result, indent=2))
|
|
475
|
+
except Exception as e:
|
|
476
|
+
click.echo(f"Error: {e}")
|
|
477
|
+
|
|
478
|
+
__all__ = ['share']
|