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
|
@@ -0,0 +1,2202 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Microsoft Purview Management Client - Complete API Coverage
|
|
3
|
+
Handles all Account Management, Resource Provider, and Azure Management operations
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import uuid
|
|
7
|
+
from .endpoint import Endpoint, decorator, get_json
|
|
8
|
+
from .endpoints import ENDPOINTS, format_endpoint, get_api_version_params
|
|
9
|
+
|
|
10
|
+
class Management(Endpoint):
|
|
11
|
+
def __init__(self):
|
|
12
|
+
Endpoint.__init__(self)
|
|
13
|
+
self.app = 'management'
|
|
14
|
+
|
|
15
|
+
# ========== Resource Provider Operations ==========
|
|
16
|
+
|
|
17
|
+
@decorator
|
|
18
|
+
def managementListOperations(self, args):
|
|
19
|
+
"""
|
|
20
|
+
Retrieve management resource information.
|
|
21
|
+
|
|
22
|
+
Retrieves detailed information about the specified management resource.
|
|
23
|
+
Returns complete management resource metadata and properties.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
args: Dictionary of operation arguments.
|
|
27
|
+
Contains operation-specific parameters.
|
|
28
|
+
See method implementation for details.
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
List of resource dictionaries, each containing:
|
|
32
|
+
- guid (str): Unique identifier
|
|
33
|
+
- name (str): Resource name
|
|
34
|
+
- attributes (dict): Resource attributes
|
|
35
|
+
- status (str): Resource status
|
|
36
|
+
|
|
37
|
+
Returns empty list if no resources found.
|
|
38
|
+
|
|
39
|
+
Raises:
|
|
40
|
+
ValueError: When required parameters are missing or invalid:
|
|
41
|
+
- Empty or None values for required fields
|
|
42
|
+
- Invalid GUID format
|
|
43
|
+
- Out-of-range values
|
|
44
|
+
|
|
45
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
46
|
+
- DefaultAzureCredential not configured
|
|
47
|
+
- Insufficient permissions
|
|
48
|
+
- Expired authentication token
|
|
49
|
+
|
|
50
|
+
HTTPError: When Purview API returns error:
|
|
51
|
+
- 400: Bad request (invalid parameters)
|
|
52
|
+
- 401: Unauthorized (authentication failed)
|
|
53
|
+
- 403: Forbidden (insufficient permissions)
|
|
54
|
+
- 404: Resource not found
|
|
55
|
+
- 429: Rate limit exceeded
|
|
56
|
+
- 500: Internal server error
|
|
57
|
+
|
|
58
|
+
NetworkError: When network connectivity fails
|
|
59
|
+
|
|
60
|
+
Example:
|
|
61
|
+
# Basic usage
|
|
62
|
+
client = Management()
|
|
63
|
+
|
|
64
|
+
result = client.managementListOperations(args=...)
|
|
65
|
+
print(f"Result: {result}")
|
|
66
|
+
|
|
67
|
+
Use Cases:
|
|
68
|
+
- Data Discovery: Find and explore data assets
|
|
69
|
+
- Compliance Auditing: Review metadata and classifications
|
|
70
|
+
- Reporting: Generate catalog reports
|
|
71
|
+
"""
|
|
72
|
+
self.method = 'GET'
|
|
73
|
+
self.endpoint = ENDPOINTS['management']['operations']
|
|
74
|
+
self.params = get_api_version_params('account')
|
|
75
|
+
|
|
76
|
+
# ========== Account Management ==========
|
|
77
|
+
|
|
78
|
+
@decorator
|
|
79
|
+
def managementCheckNameAvailability(self, args):
|
|
80
|
+
"""
|
|
81
|
+
Perform operation on resource.
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
args: Dictionary of operation arguments.
|
|
87
|
+
Contains operation-specific parameters.
|
|
88
|
+
See method implementation for details.
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
[TODO: Specify return type and structure]
|
|
92
|
+
[TODO: Document nested fields]
|
|
93
|
+
|
|
94
|
+
Raises:
|
|
95
|
+
ValueError: When required parameters are missing or invalid:
|
|
96
|
+
- Empty or None values for required fields
|
|
97
|
+
- Invalid GUID format
|
|
98
|
+
- Out-of-range values
|
|
99
|
+
|
|
100
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
101
|
+
- DefaultAzureCredential not configured
|
|
102
|
+
- Insufficient permissions
|
|
103
|
+
- Expired authentication token
|
|
104
|
+
|
|
105
|
+
HTTPError: When Purview API returns error:
|
|
106
|
+
- 400: Bad request (invalid parameters)
|
|
107
|
+
- 401: Unauthorized (authentication failed)
|
|
108
|
+
- 403: Forbidden (insufficient permissions)
|
|
109
|
+
- 404: Resource not found
|
|
110
|
+
- 429: Rate limit exceeded
|
|
111
|
+
- 500: Internal server error
|
|
112
|
+
|
|
113
|
+
NetworkError: When network connectivity fails
|
|
114
|
+
|
|
115
|
+
Example:
|
|
116
|
+
# Basic usage
|
|
117
|
+
client = Management()
|
|
118
|
+
|
|
119
|
+
result = client.managementCheckNameAvailability(args=...)
|
|
120
|
+
print(f"Result: {result}")
|
|
121
|
+
|
|
122
|
+
Use Cases:
|
|
123
|
+
- [TODO: Add specific use cases for this operation]
|
|
124
|
+
- [TODO: Include business context]
|
|
125
|
+
- [TODO: Explain when to use this method]
|
|
126
|
+
"""
|
|
127
|
+
self.method = 'POST'
|
|
128
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['check_name_availability'],
|
|
129
|
+
subscriptionId=args["--subscriptionId"])
|
|
130
|
+
self.params = get_api_version_params('account')
|
|
131
|
+
self.payload = {
|
|
132
|
+
'name': args['--accountName'],
|
|
133
|
+
'type': 'Microsoft.Purview/accounts'
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@decorator
|
|
137
|
+
def managementReadAccounts(self, args):
|
|
138
|
+
"""
|
|
139
|
+
Retrieve management resource information.
|
|
140
|
+
|
|
141
|
+
Retrieves detailed information about the specified management resource.
|
|
142
|
+
Returns complete management resource metadata and properties.
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
args: Dictionary of operation arguments.
|
|
146
|
+
Contains operation-specific parameters.
|
|
147
|
+
See method implementation for details.
|
|
148
|
+
|
|
149
|
+
Returns:
|
|
150
|
+
Dictionary containing management resource information:
|
|
151
|
+
{
|
|
152
|
+
'guid': str, # Unique identifier
|
|
153
|
+
'name': str, # Resource name
|
|
154
|
+
'attributes': dict, # Resource attributes
|
|
155
|
+
'status': str, # Resource status
|
|
156
|
+
'updateTime': int # Last update timestamp
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
Raises:
|
|
160
|
+
ValueError: When required parameters are missing or invalid:
|
|
161
|
+
- Empty or None values for required fields
|
|
162
|
+
- Invalid GUID format
|
|
163
|
+
- Out-of-range values
|
|
164
|
+
|
|
165
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
166
|
+
- DefaultAzureCredential not configured
|
|
167
|
+
- Insufficient permissions
|
|
168
|
+
- Expired authentication token
|
|
169
|
+
|
|
170
|
+
HTTPError: When Purview API returns error:
|
|
171
|
+
- 400: Bad request (invalid parameters)
|
|
172
|
+
- 401: Unauthorized (authentication failed)
|
|
173
|
+
- 403: Forbidden (insufficient permissions)
|
|
174
|
+
- 404: Resource not found
|
|
175
|
+
- 429: Rate limit exceeded
|
|
176
|
+
- 500: Internal server error
|
|
177
|
+
|
|
178
|
+
NetworkError: When network connectivity fails
|
|
179
|
+
|
|
180
|
+
Example:
|
|
181
|
+
# Basic usage
|
|
182
|
+
client = Management()
|
|
183
|
+
|
|
184
|
+
result = client.managementReadAccounts(args=...)
|
|
185
|
+
print(f"Result: {result}")
|
|
186
|
+
|
|
187
|
+
Use Cases:
|
|
188
|
+
- Data Discovery: Find and explore data assets
|
|
189
|
+
- Compliance Auditing: Review metadata and classifications
|
|
190
|
+
- Reporting: Generate catalog reports
|
|
191
|
+
"""
|
|
192
|
+
self.method = 'GET'
|
|
193
|
+
if args.get("--resourceGroupName") is None:
|
|
194
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['accounts'],
|
|
195
|
+
subscriptionId=args["--subscriptionId"])
|
|
196
|
+
else:
|
|
197
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['accounts_by_rg'],
|
|
198
|
+
subscriptionId=args["--subscriptionId"],
|
|
199
|
+
resourceGroupName=args["--resourceGroupName"])
|
|
200
|
+
self.params = get_api_version_params('account')
|
|
201
|
+
|
|
202
|
+
@decorator
|
|
203
|
+
def managementReadAccount(self, args):
|
|
204
|
+
"""
|
|
205
|
+
Retrieve management resource information.
|
|
206
|
+
|
|
207
|
+
Retrieves detailed information about the specified management resource.
|
|
208
|
+
Returns complete management resource metadata and properties.
|
|
209
|
+
|
|
210
|
+
Args:
|
|
211
|
+
args: Dictionary of operation arguments.
|
|
212
|
+
Contains operation-specific parameters.
|
|
213
|
+
See method implementation for details.
|
|
214
|
+
|
|
215
|
+
Returns:
|
|
216
|
+
Dictionary containing management resource information:
|
|
217
|
+
{
|
|
218
|
+
'guid': str, # Unique identifier
|
|
219
|
+
'name': str, # Resource name
|
|
220
|
+
'attributes': dict, # Resource attributes
|
|
221
|
+
'status': str, # Resource status
|
|
222
|
+
'updateTime': int # Last update timestamp
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
Raises:
|
|
226
|
+
ValueError: When required parameters are missing or invalid:
|
|
227
|
+
- Empty or None values for required fields
|
|
228
|
+
- Invalid GUID format
|
|
229
|
+
- Out-of-range values
|
|
230
|
+
|
|
231
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
232
|
+
- DefaultAzureCredential not configured
|
|
233
|
+
- Insufficient permissions
|
|
234
|
+
- Expired authentication token
|
|
235
|
+
|
|
236
|
+
HTTPError: When Purview API returns error:
|
|
237
|
+
- 400: Bad request (invalid parameters)
|
|
238
|
+
- 401: Unauthorized (authentication failed)
|
|
239
|
+
- 403: Forbidden (insufficient permissions)
|
|
240
|
+
- 404: Resource not found
|
|
241
|
+
- 429: Rate limit exceeded
|
|
242
|
+
- 500: Internal server error
|
|
243
|
+
|
|
244
|
+
NetworkError: When network connectivity fails
|
|
245
|
+
|
|
246
|
+
Example:
|
|
247
|
+
# Basic usage
|
|
248
|
+
client = Management()
|
|
249
|
+
|
|
250
|
+
result = client.managementReadAccount(args=...)
|
|
251
|
+
print(f"Result: {result}")
|
|
252
|
+
|
|
253
|
+
Use Cases:
|
|
254
|
+
- Data Discovery: Find and explore data assets
|
|
255
|
+
- Compliance Auditing: Review metadata and classifications
|
|
256
|
+
- Reporting: Generate catalog reports
|
|
257
|
+
"""
|
|
258
|
+
self.method = 'GET'
|
|
259
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['account'],
|
|
260
|
+
subscriptionId=args["--subscriptionId"],
|
|
261
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
262
|
+
accountName=args["--accountName"])
|
|
263
|
+
self.params = get_api_version_params('account')
|
|
264
|
+
|
|
265
|
+
@decorator
|
|
266
|
+
def managementCreateAccount(self, args):
|
|
267
|
+
"""
|
|
268
|
+
Create a new management resource.
|
|
269
|
+
|
|
270
|
+
Creates a new management resource in Microsoft Purview.
|
|
271
|
+
Requires appropriate permissions and valid management resource definition.
|
|
272
|
+
|
|
273
|
+
Args:
|
|
274
|
+
args: Dictionary of operation arguments.
|
|
275
|
+
Contains operation-specific parameters.
|
|
276
|
+
See method implementation for details.
|
|
277
|
+
|
|
278
|
+
Returns:
|
|
279
|
+
Dictionary containing created management resource:
|
|
280
|
+
{
|
|
281
|
+
'guid': str, # Unique identifier
|
|
282
|
+
'name': str, # Resource name
|
|
283
|
+
'status': str, # Creation status
|
|
284
|
+
'attributes': dict, # Resource attributes
|
|
285
|
+
'createTime': int # Creation timestamp
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
Raises:
|
|
289
|
+
ValueError: When required parameters are missing or invalid:
|
|
290
|
+
- Empty or None values for required fields
|
|
291
|
+
- Invalid GUID format
|
|
292
|
+
- Out-of-range values
|
|
293
|
+
|
|
294
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
295
|
+
- DefaultAzureCredential not configured
|
|
296
|
+
- Insufficient permissions
|
|
297
|
+
- Expired authentication token
|
|
298
|
+
|
|
299
|
+
HTTPError: When Purview API returns error:
|
|
300
|
+
- 400: Bad request (invalid parameters)
|
|
301
|
+
- 401: Unauthorized (authentication failed)
|
|
302
|
+
- 403: Forbidden (insufficient permissions)
|
|
303
|
+
- 404: Resource not found
|
|
304
|
+
- 409: Conflict (resource already exists)
|
|
305
|
+
- 429: Rate limit exceeded
|
|
306
|
+
- 500: Internal server error
|
|
307
|
+
|
|
308
|
+
NetworkError: When network connectivity fails
|
|
309
|
+
|
|
310
|
+
Example:
|
|
311
|
+
# Basic usage
|
|
312
|
+
client = Management()
|
|
313
|
+
|
|
314
|
+
result = client.managementCreateAccount(args=...)
|
|
315
|
+
print(f"Result: {result}")
|
|
316
|
+
|
|
317
|
+
# With detailed data
|
|
318
|
+
data = {
|
|
319
|
+
'name': 'My Resource',
|
|
320
|
+
'description': 'Resource description',
|
|
321
|
+
'attributes': {
|
|
322
|
+
'key1': 'value1',
|
|
323
|
+
'key2': 'value2'
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
result = client.managementCreateAccount(data)
|
|
328
|
+
print(f"Created/Updated: {result['guid']}")
|
|
329
|
+
|
|
330
|
+
Use Cases:
|
|
331
|
+
- Data Onboarding: Register new data sources in catalog
|
|
332
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
333
|
+
- Automation: Programmatically populate catalog
|
|
334
|
+
"""
|
|
335
|
+
self.method = 'PUT'
|
|
336
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['account'],
|
|
337
|
+
subscriptionId=args["--subscriptionId"],
|
|
338
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
339
|
+
accountName=args["--accountName"])
|
|
340
|
+
self.params = get_api_version_params('account')
|
|
341
|
+
self.payload = get_json(args, '--payloadFile')
|
|
342
|
+
|
|
343
|
+
@decorator
|
|
344
|
+
def managementUpdateAccount(self, args):
|
|
345
|
+
"""
|
|
346
|
+
Update an existing management resource.
|
|
347
|
+
|
|
348
|
+
Updates an existing management resource with new values.
|
|
349
|
+
Only specified fields are modified; others remain unchanged.
|
|
350
|
+
|
|
351
|
+
Args:
|
|
352
|
+
args: Dictionary of operation arguments.
|
|
353
|
+
Contains operation-specific parameters.
|
|
354
|
+
See method implementation for details.
|
|
355
|
+
|
|
356
|
+
Returns:
|
|
357
|
+
Dictionary containing updated management resource:
|
|
358
|
+
{
|
|
359
|
+
'guid': str, # Unique identifier
|
|
360
|
+
'attributes': dict, # Updated attributes
|
|
361
|
+
'updateTime': int # Update timestamp
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
Raises:
|
|
365
|
+
ValueError: When required parameters are missing or invalid:
|
|
366
|
+
- Empty or None values for required fields
|
|
367
|
+
- Invalid GUID format
|
|
368
|
+
- Out-of-range values
|
|
369
|
+
|
|
370
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
371
|
+
- DefaultAzureCredential not configured
|
|
372
|
+
- Insufficient permissions
|
|
373
|
+
- Expired authentication token
|
|
374
|
+
|
|
375
|
+
HTTPError: When Purview API returns error:
|
|
376
|
+
- 400: Bad request (invalid parameters)
|
|
377
|
+
- 401: Unauthorized (authentication failed)
|
|
378
|
+
- 403: Forbidden (insufficient permissions)
|
|
379
|
+
- 404: Resource not found
|
|
380
|
+
- 429: Rate limit exceeded
|
|
381
|
+
- 500: Internal server error
|
|
382
|
+
|
|
383
|
+
NetworkError: When network connectivity fails
|
|
384
|
+
|
|
385
|
+
Example:
|
|
386
|
+
# Basic usage
|
|
387
|
+
client = Management()
|
|
388
|
+
|
|
389
|
+
result = client.managementUpdateAccount(args=...)
|
|
390
|
+
print(f"Result: {result}")
|
|
391
|
+
|
|
392
|
+
# With detailed data
|
|
393
|
+
data = {
|
|
394
|
+
'name': 'My Resource',
|
|
395
|
+
'description': 'Resource description',
|
|
396
|
+
'attributes': {
|
|
397
|
+
'key1': 'value1',
|
|
398
|
+
'key2': 'value2'
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
result = client.managementUpdateAccount(data)
|
|
403
|
+
print(f"Created/Updated: {result['guid']}")
|
|
404
|
+
|
|
405
|
+
Use Cases:
|
|
406
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
407
|
+
- Ownership Changes: Reassign data ownership
|
|
408
|
+
- Classification: Apply or modify data classifications
|
|
409
|
+
"""
|
|
410
|
+
self.method = 'PATCH'
|
|
411
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['account'],
|
|
412
|
+
subscriptionId=args["--subscriptionId"],
|
|
413
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
414
|
+
accountName=args["--accountName"])
|
|
415
|
+
self.params = get_api_version_params('account')
|
|
416
|
+
self.payload = get_json(args, '--payloadFile')
|
|
417
|
+
|
|
418
|
+
@decorator
|
|
419
|
+
def managementDeleteAccount(self, args):
|
|
420
|
+
"""
|
|
421
|
+
Delete a management resource.
|
|
422
|
+
|
|
423
|
+
Permanently deletes the specified management resource.
|
|
424
|
+
This operation cannot be undone. Use with caution.
|
|
425
|
+
|
|
426
|
+
Args:
|
|
427
|
+
args: Dictionary of operation arguments.
|
|
428
|
+
Contains operation-specific parameters.
|
|
429
|
+
See method implementation for details.
|
|
430
|
+
|
|
431
|
+
Returns:
|
|
432
|
+
Dictionary with deletion status:
|
|
433
|
+
{
|
|
434
|
+
'guid': str, # Deleted resource ID
|
|
435
|
+
'status': str, # Deletion status
|
|
436
|
+
'message': str # Confirmation message
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
Raises:
|
|
440
|
+
ValueError: When required parameters are missing or invalid:
|
|
441
|
+
- Empty or None values for required fields
|
|
442
|
+
- Invalid GUID format
|
|
443
|
+
- Out-of-range values
|
|
444
|
+
|
|
445
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
446
|
+
- DefaultAzureCredential not configured
|
|
447
|
+
- Insufficient permissions
|
|
448
|
+
- Expired authentication token
|
|
449
|
+
|
|
450
|
+
HTTPError: When Purview API returns error:
|
|
451
|
+
- 400: Bad request (invalid parameters)
|
|
452
|
+
- 401: Unauthorized (authentication failed)
|
|
453
|
+
- 403: Forbidden (insufficient permissions)
|
|
454
|
+
- 404: Resource not found
|
|
455
|
+
- 429: Rate limit exceeded
|
|
456
|
+
- 500: Internal server error
|
|
457
|
+
|
|
458
|
+
NetworkError: When network connectivity fails
|
|
459
|
+
|
|
460
|
+
Example:
|
|
461
|
+
# Basic usage
|
|
462
|
+
client = Management()
|
|
463
|
+
|
|
464
|
+
result = client.managementDeleteAccount(args=...)
|
|
465
|
+
print(f"Result: {result}")
|
|
466
|
+
|
|
467
|
+
Use Cases:
|
|
468
|
+
- Data Cleanup: Remove obsolete or test data
|
|
469
|
+
- Decommissioning: Delete resources no longer in use
|
|
470
|
+
- Testing: Clean up test environments
|
|
471
|
+
"""
|
|
472
|
+
self.method = 'DELETE'
|
|
473
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['account'],
|
|
474
|
+
subscriptionId=args["--subscriptionId"],
|
|
475
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
476
|
+
accountName=args["--accountName"])
|
|
477
|
+
self.params = get_api_version_params('account')
|
|
478
|
+
|
|
479
|
+
# ========== Account Keys Management ==========
|
|
480
|
+
|
|
481
|
+
@decorator
|
|
482
|
+
def managementGetAccessKeys(self, args):
|
|
483
|
+
"""
|
|
484
|
+
Retrieve management resource information.
|
|
485
|
+
|
|
486
|
+
Retrieves detailed information about the specified management resource.
|
|
487
|
+
Returns complete management resource metadata and properties.
|
|
488
|
+
|
|
489
|
+
Args:
|
|
490
|
+
args: Dictionary of operation arguments.
|
|
491
|
+
Contains operation-specific parameters.
|
|
492
|
+
See method implementation for details.
|
|
493
|
+
|
|
494
|
+
Returns:
|
|
495
|
+
Dictionary containing management resource information:
|
|
496
|
+
{
|
|
497
|
+
'guid': str, # Unique identifier
|
|
498
|
+
'name': str, # Resource name
|
|
499
|
+
'attributes': dict, # Resource attributes
|
|
500
|
+
'status': str, # Resource status
|
|
501
|
+
'updateTime': int # Last update timestamp
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
Raises:
|
|
505
|
+
ValueError: When required parameters are missing or invalid:
|
|
506
|
+
- Empty or None values for required fields
|
|
507
|
+
- Invalid GUID format
|
|
508
|
+
- Out-of-range values
|
|
509
|
+
|
|
510
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
511
|
+
- DefaultAzureCredential not configured
|
|
512
|
+
- Insufficient permissions
|
|
513
|
+
- Expired authentication token
|
|
514
|
+
|
|
515
|
+
HTTPError: When Purview API returns error:
|
|
516
|
+
- 400: Bad request (invalid parameters)
|
|
517
|
+
- 401: Unauthorized (authentication failed)
|
|
518
|
+
- 403: Forbidden (insufficient permissions)
|
|
519
|
+
- 404: Resource not found
|
|
520
|
+
- 429: Rate limit exceeded
|
|
521
|
+
- 500: Internal server error
|
|
522
|
+
|
|
523
|
+
NetworkError: When network connectivity fails
|
|
524
|
+
|
|
525
|
+
Example:
|
|
526
|
+
# Basic usage
|
|
527
|
+
client = Management()
|
|
528
|
+
|
|
529
|
+
result = client.managementGetAccessKeys(args=...)
|
|
530
|
+
print(f"Result: {result}")
|
|
531
|
+
|
|
532
|
+
Use Cases:
|
|
533
|
+
- Data Discovery: Find and explore data assets
|
|
534
|
+
- Compliance Auditing: Review metadata and classifications
|
|
535
|
+
- Reporting: Generate catalog reports
|
|
536
|
+
"""
|
|
537
|
+
self.method = 'POST'
|
|
538
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['access_keys'],
|
|
539
|
+
subscriptionId=args["--subscriptionId"],
|
|
540
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
541
|
+
accountName=args["--accountName"])
|
|
542
|
+
self.params = get_api_version_params('account')
|
|
543
|
+
|
|
544
|
+
@decorator
|
|
545
|
+
def managementRegenerateAccessKey(self, args):
|
|
546
|
+
"""
|
|
547
|
+
Perform operation on resource.
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
Args:
|
|
552
|
+
args: Dictionary of operation arguments.
|
|
553
|
+
Contains operation-specific parameters.
|
|
554
|
+
See method implementation for details.
|
|
555
|
+
|
|
556
|
+
Returns:
|
|
557
|
+
[TODO: Specify return type and structure]
|
|
558
|
+
[TODO: Document nested fields]
|
|
559
|
+
|
|
560
|
+
Raises:
|
|
561
|
+
ValueError: When required parameters are missing or invalid:
|
|
562
|
+
- Empty or None values for required fields
|
|
563
|
+
- Invalid GUID format
|
|
564
|
+
- Out-of-range values
|
|
565
|
+
|
|
566
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
567
|
+
- DefaultAzureCredential not configured
|
|
568
|
+
- Insufficient permissions
|
|
569
|
+
- Expired authentication token
|
|
570
|
+
|
|
571
|
+
HTTPError: When Purview API returns error:
|
|
572
|
+
- 400: Bad request (invalid parameters)
|
|
573
|
+
- 401: Unauthorized (authentication failed)
|
|
574
|
+
- 403: Forbidden (insufficient permissions)
|
|
575
|
+
- 404: Resource not found
|
|
576
|
+
- 429: Rate limit exceeded
|
|
577
|
+
- 500: Internal server error
|
|
578
|
+
|
|
579
|
+
NetworkError: When network connectivity fails
|
|
580
|
+
|
|
581
|
+
Example:
|
|
582
|
+
# Basic usage
|
|
583
|
+
client = Management()
|
|
584
|
+
|
|
585
|
+
result = client.managementRegenerateAccessKey(args=...)
|
|
586
|
+
print(f"Result: {result}")
|
|
587
|
+
|
|
588
|
+
Use Cases:
|
|
589
|
+
- [TODO: Add specific use cases for this operation]
|
|
590
|
+
- [TODO: Include business context]
|
|
591
|
+
- [TODO: Explain when to use this method]
|
|
592
|
+
"""
|
|
593
|
+
self.method = 'POST'
|
|
594
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['regenerate_access_key'],
|
|
595
|
+
subscriptionId=args["--subscriptionId"],
|
|
596
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
597
|
+
accountName=args["--accountName"])
|
|
598
|
+
self.params = get_api_version_params('account')
|
|
599
|
+
self.payload = {'keyType': args.get('--keyType', 'PrimaryAccessKey')}
|
|
600
|
+
|
|
601
|
+
# ========== Private Link Resources ==========
|
|
602
|
+
|
|
603
|
+
@decorator
|
|
604
|
+
def managementListPrivateLinkResources(self, args):
|
|
605
|
+
"""
|
|
606
|
+
Retrieve management resource information.
|
|
607
|
+
|
|
608
|
+
Retrieves detailed information about the specified management resource.
|
|
609
|
+
Returns complete management resource metadata and properties.
|
|
610
|
+
|
|
611
|
+
Args:
|
|
612
|
+
args: Dictionary of operation arguments.
|
|
613
|
+
Contains operation-specific parameters.
|
|
614
|
+
See method implementation for details.
|
|
615
|
+
|
|
616
|
+
Returns:
|
|
617
|
+
List of resource dictionaries, each containing:
|
|
618
|
+
- guid (str): Unique identifier
|
|
619
|
+
- name (str): Resource name
|
|
620
|
+
- attributes (dict): Resource attributes
|
|
621
|
+
- status (str): Resource status
|
|
622
|
+
|
|
623
|
+
Returns empty list if no resources found.
|
|
624
|
+
|
|
625
|
+
Raises:
|
|
626
|
+
ValueError: When required parameters are missing or invalid:
|
|
627
|
+
- Empty or None values for required fields
|
|
628
|
+
- Invalid GUID format
|
|
629
|
+
- Out-of-range values
|
|
630
|
+
|
|
631
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
632
|
+
- DefaultAzureCredential not configured
|
|
633
|
+
- Insufficient permissions
|
|
634
|
+
- Expired authentication token
|
|
635
|
+
|
|
636
|
+
HTTPError: When Purview API returns error:
|
|
637
|
+
- 400: Bad request (invalid parameters)
|
|
638
|
+
- 401: Unauthorized (authentication failed)
|
|
639
|
+
- 403: Forbidden (insufficient permissions)
|
|
640
|
+
- 404: Resource not found
|
|
641
|
+
- 429: Rate limit exceeded
|
|
642
|
+
- 500: Internal server error
|
|
643
|
+
|
|
644
|
+
NetworkError: When network connectivity fails
|
|
645
|
+
|
|
646
|
+
Example:
|
|
647
|
+
# Basic usage
|
|
648
|
+
client = Management()
|
|
649
|
+
|
|
650
|
+
result = client.managementListPrivateLinkResources(args=...)
|
|
651
|
+
print(f"Result: {result}")
|
|
652
|
+
|
|
653
|
+
Use Cases:
|
|
654
|
+
- Data Discovery: Find and explore data assets
|
|
655
|
+
- Compliance Auditing: Review metadata and classifications
|
|
656
|
+
- Reporting: Generate catalog reports
|
|
657
|
+
"""
|
|
658
|
+
self.method = 'GET'
|
|
659
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['private_link_resources'],
|
|
660
|
+
subscriptionId=args["--subscriptionId"],
|
|
661
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
662
|
+
accountName=args["--accountName"])
|
|
663
|
+
self.params = get_api_version_params('account')
|
|
664
|
+
|
|
665
|
+
@decorator
|
|
666
|
+
def managementGetPrivateLinkResource(self, args):
|
|
667
|
+
"""
|
|
668
|
+
Retrieve management resource information.
|
|
669
|
+
|
|
670
|
+
Retrieves detailed information about the specified management resource.
|
|
671
|
+
Returns complete management resource metadata and properties.
|
|
672
|
+
|
|
673
|
+
Args:
|
|
674
|
+
args: Dictionary of operation arguments.
|
|
675
|
+
Contains operation-specific parameters.
|
|
676
|
+
See method implementation for details.
|
|
677
|
+
|
|
678
|
+
Returns:
|
|
679
|
+
Dictionary containing management resource information:
|
|
680
|
+
{
|
|
681
|
+
'guid': str, # Unique identifier
|
|
682
|
+
'name': str, # Resource name
|
|
683
|
+
'attributes': dict, # Resource attributes
|
|
684
|
+
'status': str, # Resource status
|
|
685
|
+
'updateTime': int # Last update timestamp
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
Raises:
|
|
689
|
+
ValueError: When required parameters are missing or invalid:
|
|
690
|
+
- Empty or None values for required fields
|
|
691
|
+
- Invalid GUID format
|
|
692
|
+
- Out-of-range values
|
|
693
|
+
|
|
694
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
695
|
+
- DefaultAzureCredential not configured
|
|
696
|
+
- Insufficient permissions
|
|
697
|
+
- Expired authentication token
|
|
698
|
+
|
|
699
|
+
HTTPError: When Purview API returns error:
|
|
700
|
+
- 400: Bad request (invalid parameters)
|
|
701
|
+
- 401: Unauthorized (authentication failed)
|
|
702
|
+
- 403: Forbidden (insufficient permissions)
|
|
703
|
+
- 404: Resource not found
|
|
704
|
+
- 429: Rate limit exceeded
|
|
705
|
+
- 500: Internal server error
|
|
706
|
+
|
|
707
|
+
NetworkError: When network connectivity fails
|
|
708
|
+
|
|
709
|
+
Example:
|
|
710
|
+
# Basic usage
|
|
711
|
+
client = Management()
|
|
712
|
+
|
|
713
|
+
result = client.managementGetPrivateLinkResource(args=...)
|
|
714
|
+
print(f"Result: {result}")
|
|
715
|
+
|
|
716
|
+
Use Cases:
|
|
717
|
+
- Data Discovery: Find and explore data assets
|
|
718
|
+
- Compliance Auditing: Review metadata and classifications
|
|
719
|
+
- Reporting: Generate catalog reports
|
|
720
|
+
"""
|
|
721
|
+
self.method = 'GET'
|
|
722
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['private_link_resource'],
|
|
723
|
+
subscriptionId=args["--subscriptionId"],
|
|
724
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
725
|
+
accountName=args["--accountName"],
|
|
726
|
+
privateLinkResourceName=args["--privateLinkResourceName"])
|
|
727
|
+
self.params = get_api_version_params('account')
|
|
728
|
+
|
|
729
|
+
# ========== Private Endpoint Connections ==========
|
|
730
|
+
|
|
731
|
+
@decorator
|
|
732
|
+
def managementListPrivateEndpointConnections(self, args):
|
|
733
|
+
"""
|
|
734
|
+
Retrieve management resource information.
|
|
735
|
+
|
|
736
|
+
Retrieves detailed information about the specified management resource.
|
|
737
|
+
Returns complete management resource metadata and properties.
|
|
738
|
+
|
|
739
|
+
Args:
|
|
740
|
+
args: Dictionary of operation arguments.
|
|
741
|
+
Contains operation-specific parameters.
|
|
742
|
+
See method implementation for details.
|
|
743
|
+
|
|
744
|
+
Returns:
|
|
745
|
+
List of resource dictionaries, each containing:
|
|
746
|
+
- guid (str): Unique identifier
|
|
747
|
+
- name (str): Resource name
|
|
748
|
+
- attributes (dict): Resource attributes
|
|
749
|
+
- status (str): Resource status
|
|
750
|
+
|
|
751
|
+
Returns empty list if no resources found.
|
|
752
|
+
|
|
753
|
+
Raises:
|
|
754
|
+
ValueError: When required parameters are missing or invalid:
|
|
755
|
+
- Empty or None values for required fields
|
|
756
|
+
- Invalid GUID format
|
|
757
|
+
- Out-of-range values
|
|
758
|
+
|
|
759
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
760
|
+
- DefaultAzureCredential not configured
|
|
761
|
+
- Insufficient permissions
|
|
762
|
+
- Expired authentication token
|
|
763
|
+
|
|
764
|
+
HTTPError: When Purview API returns error:
|
|
765
|
+
- 400: Bad request (invalid parameters)
|
|
766
|
+
- 401: Unauthorized (authentication failed)
|
|
767
|
+
- 403: Forbidden (insufficient permissions)
|
|
768
|
+
- 404: Resource not found
|
|
769
|
+
- 429: Rate limit exceeded
|
|
770
|
+
- 500: Internal server error
|
|
771
|
+
|
|
772
|
+
NetworkError: When network connectivity fails
|
|
773
|
+
|
|
774
|
+
Example:
|
|
775
|
+
# Basic usage
|
|
776
|
+
client = Management()
|
|
777
|
+
|
|
778
|
+
result = client.managementListPrivateEndpointConnections(args=...)
|
|
779
|
+
print(f"Result: {result}")
|
|
780
|
+
|
|
781
|
+
Use Cases:
|
|
782
|
+
- Data Discovery: Find and explore data assets
|
|
783
|
+
- Compliance Auditing: Review metadata and classifications
|
|
784
|
+
- Reporting: Generate catalog reports
|
|
785
|
+
"""
|
|
786
|
+
self.method = 'GET'
|
|
787
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['private_endpoint_connections'],
|
|
788
|
+
subscriptionId=args["--subscriptionId"],
|
|
789
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
790
|
+
accountName=args["--accountName"])
|
|
791
|
+
self.params = get_api_version_params('account')
|
|
792
|
+
|
|
793
|
+
@decorator
|
|
794
|
+
def managementGetPrivateEndpointConnection(self, args):
|
|
795
|
+
"""
|
|
796
|
+
Retrieve management resource information.
|
|
797
|
+
|
|
798
|
+
Retrieves detailed information about the specified management resource.
|
|
799
|
+
Returns complete management resource metadata and properties.
|
|
800
|
+
|
|
801
|
+
Args:
|
|
802
|
+
args: Dictionary of operation arguments.
|
|
803
|
+
Contains operation-specific parameters.
|
|
804
|
+
See method implementation for details.
|
|
805
|
+
|
|
806
|
+
Returns:
|
|
807
|
+
Dictionary containing management resource information:
|
|
808
|
+
{
|
|
809
|
+
'guid': str, # Unique identifier
|
|
810
|
+
'name': str, # Resource name
|
|
811
|
+
'attributes': dict, # Resource attributes
|
|
812
|
+
'status': str, # Resource status
|
|
813
|
+
'updateTime': int # Last update timestamp
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
Raises:
|
|
817
|
+
ValueError: When required parameters are missing or invalid:
|
|
818
|
+
- Empty or None values for required fields
|
|
819
|
+
- Invalid GUID format
|
|
820
|
+
- Out-of-range values
|
|
821
|
+
|
|
822
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
823
|
+
- DefaultAzureCredential not configured
|
|
824
|
+
- Insufficient permissions
|
|
825
|
+
- Expired authentication token
|
|
826
|
+
|
|
827
|
+
HTTPError: When Purview API returns error:
|
|
828
|
+
- 400: Bad request (invalid parameters)
|
|
829
|
+
- 401: Unauthorized (authentication failed)
|
|
830
|
+
- 403: Forbidden (insufficient permissions)
|
|
831
|
+
- 404: Resource not found
|
|
832
|
+
- 429: Rate limit exceeded
|
|
833
|
+
- 500: Internal server error
|
|
834
|
+
|
|
835
|
+
NetworkError: When network connectivity fails
|
|
836
|
+
|
|
837
|
+
Example:
|
|
838
|
+
# Basic usage
|
|
839
|
+
client = Management()
|
|
840
|
+
|
|
841
|
+
result = client.managementGetPrivateEndpointConnection(args=...)
|
|
842
|
+
print(f"Result: {result}")
|
|
843
|
+
|
|
844
|
+
Use Cases:
|
|
845
|
+
- Data Discovery: Find and explore data assets
|
|
846
|
+
- Compliance Auditing: Review metadata and classifications
|
|
847
|
+
- Reporting: Generate catalog reports
|
|
848
|
+
"""
|
|
849
|
+
self.method = 'GET'
|
|
850
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['private_endpoint_connection'],
|
|
851
|
+
subscriptionId=args["--subscriptionId"],
|
|
852
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
853
|
+
accountName=args["--accountName"],
|
|
854
|
+
privateEndpointConnectionName=args["--privateEndpointConnectionName"])
|
|
855
|
+
self.params = get_api_version_params('account')
|
|
856
|
+
|
|
857
|
+
@decorator
|
|
858
|
+
def managementCreateOrUpdatePrivateEndpointConnection(self, args):
|
|
859
|
+
"""
|
|
860
|
+
Create a new management resource.
|
|
861
|
+
|
|
862
|
+
Creates a new management resource in Microsoft Purview.
|
|
863
|
+
Requires appropriate permissions and valid management resource definition.
|
|
864
|
+
|
|
865
|
+
Args:
|
|
866
|
+
args: Dictionary of operation arguments.
|
|
867
|
+
Contains operation-specific parameters.
|
|
868
|
+
See method implementation for details.
|
|
869
|
+
|
|
870
|
+
Returns:
|
|
871
|
+
Dictionary containing created management resource:
|
|
872
|
+
{
|
|
873
|
+
'guid': str, # Unique identifier
|
|
874
|
+
'name': str, # Resource name
|
|
875
|
+
'status': str, # Creation status
|
|
876
|
+
'attributes': dict, # Resource attributes
|
|
877
|
+
'createTime': int # Creation timestamp
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
Raises:
|
|
881
|
+
ValueError: When required parameters are missing or invalid:
|
|
882
|
+
- Empty or None values for required fields
|
|
883
|
+
- Invalid GUID format
|
|
884
|
+
- Out-of-range values
|
|
885
|
+
|
|
886
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
887
|
+
- DefaultAzureCredential not configured
|
|
888
|
+
- Insufficient permissions
|
|
889
|
+
- Expired authentication token
|
|
890
|
+
|
|
891
|
+
HTTPError: When Purview API returns error:
|
|
892
|
+
- 400: Bad request (invalid parameters)
|
|
893
|
+
- 401: Unauthorized (authentication failed)
|
|
894
|
+
- 403: Forbidden (insufficient permissions)
|
|
895
|
+
- 404: Resource not found
|
|
896
|
+
- 409: Conflict (resource already exists)
|
|
897
|
+
- 429: Rate limit exceeded
|
|
898
|
+
- 500: Internal server error
|
|
899
|
+
|
|
900
|
+
NetworkError: When network connectivity fails
|
|
901
|
+
|
|
902
|
+
Example:
|
|
903
|
+
# Basic usage
|
|
904
|
+
client = Management()
|
|
905
|
+
|
|
906
|
+
result = client.managementCreateOrUpdatePrivateEndpointConnection(args=...)
|
|
907
|
+
print(f"Result: {result}")
|
|
908
|
+
|
|
909
|
+
# With detailed data
|
|
910
|
+
data = {
|
|
911
|
+
'name': 'My Resource',
|
|
912
|
+
'description': 'Resource description',
|
|
913
|
+
'attributes': {
|
|
914
|
+
'key1': 'value1',
|
|
915
|
+
'key2': 'value2'
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
result = client.managementCreateOrUpdatePrivateEndpointConnection(data)
|
|
920
|
+
print(f"Created/Updated: {result['guid']}")
|
|
921
|
+
|
|
922
|
+
Use Cases:
|
|
923
|
+
- Data Onboarding: Register new data sources in catalog
|
|
924
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
925
|
+
- Automation: Programmatically populate catalog
|
|
926
|
+
"""
|
|
927
|
+
self.method = 'PUT'
|
|
928
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['private_endpoint_connection'],
|
|
929
|
+
subscriptionId=args["--subscriptionId"],
|
|
930
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
931
|
+
accountName=args["--accountName"],
|
|
932
|
+
privateEndpointConnectionName=args["--privateEndpointConnectionName"])
|
|
933
|
+
self.params = get_api_version_params('account')
|
|
934
|
+
self.payload = get_json(args, '--payloadFile')
|
|
935
|
+
|
|
936
|
+
@decorator
|
|
937
|
+
def managementDeletePrivateEndpointConnection(self, args):
|
|
938
|
+
"""
|
|
939
|
+
Delete a management resource.
|
|
940
|
+
|
|
941
|
+
Permanently deletes the specified management resource.
|
|
942
|
+
This operation cannot be undone. Use with caution.
|
|
943
|
+
|
|
944
|
+
Args:
|
|
945
|
+
args: Dictionary of operation arguments.
|
|
946
|
+
Contains operation-specific parameters.
|
|
947
|
+
See method implementation for details.
|
|
948
|
+
|
|
949
|
+
Returns:
|
|
950
|
+
Dictionary with deletion status:
|
|
951
|
+
{
|
|
952
|
+
'guid': str, # Deleted resource ID
|
|
953
|
+
'status': str, # Deletion status
|
|
954
|
+
'message': str # Confirmation message
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
Raises:
|
|
958
|
+
ValueError: When required parameters are missing or invalid:
|
|
959
|
+
- Empty or None values for required fields
|
|
960
|
+
- Invalid GUID format
|
|
961
|
+
- Out-of-range values
|
|
962
|
+
|
|
963
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
964
|
+
- DefaultAzureCredential not configured
|
|
965
|
+
- Insufficient permissions
|
|
966
|
+
- Expired authentication token
|
|
967
|
+
|
|
968
|
+
HTTPError: When Purview API returns error:
|
|
969
|
+
- 400: Bad request (invalid parameters)
|
|
970
|
+
- 401: Unauthorized (authentication failed)
|
|
971
|
+
- 403: Forbidden (insufficient permissions)
|
|
972
|
+
- 404: Resource not found
|
|
973
|
+
- 429: Rate limit exceeded
|
|
974
|
+
- 500: Internal server error
|
|
975
|
+
|
|
976
|
+
NetworkError: When network connectivity fails
|
|
977
|
+
|
|
978
|
+
Example:
|
|
979
|
+
# Basic usage
|
|
980
|
+
client = Management()
|
|
981
|
+
|
|
982
|
+
result = client.managementDeletePrivateEndpointConnection(args=...)
|
|
983
|
+
print(f"Result: {result}")
|
|
984
|
+
|
|
985
|
+
Use Cases:
|
|
986
|
+
- Data Cleanup: Remove obsolete or test data
|
|
987
|
+
- Decommissioning: Delete resources no longer in use
|
|
988
|
+
- Testing: Clean up test environments
|
|
989
|
+
"""
|
|
990
|
+
self.method = 'DELETE'
|
|
991
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['private_endpoint_connection'],
|
|
992
|
+
subscriptionId=args["--subscriptionId"],
|
|
993
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
994
|
+
accountName=args["--accountName"],
|
|
995
|
+
privateEndpointConnectionName=args["--privateEndpointConnectionName"])
|
|
996
|
+
self.params = get_api_version_params('account')
|
|
997
|
+
|
|
998
|
+
# ========== Account Features and Configuration ==========
|
|
999
|
+
|
|
1000
|
+
@decorator
|
|
1001
|
+
def managementGetAccountFeatures(self, args):
|
|
1002
|
+
"""
|
|
1003
|
+
Retrieve management resource information.
|
|
1004
|
+
|
|
1005
|
+
Retrieves detailed information about the specified management resource.
|
|
1006
|
+
Returns complete management resource metadata and properties.
|
|
1007
|
+
|
|
1008
|
+
Args:
|
|
1009
|
+
args: Dictionary of operation arguments.
|
|
1010
|
+
Contains operation-specific parameters.
|
|
1011
|
+
See method implementation for details.
|
|
1012
|
+
|
|
1013
|
+
Returns:
|
|
1014
|
+
Dictionary containing management resource information:
|
|
1015
|
+
{
|
|
1016
|
+
'guid': str, # Unique identifier
|
|
1017
|
+
'name': str, # Resource name
|
|
1018
|
+
'attributes': dict, # Resource attributes
|
|
1019
|
+
'status': str, # Resource status
|
|
1020
|
+
'updateTime': int # Last update timestamp
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
Raises:
|
|
1024
|
+
ValueError: When required parameters are missing or invalid:
|
|
1025
|
+
- Empty or None values for required fields
|
|
1026
|
+
- Invalid GUID format
|
|
1027
|
+
- Out-of-range values
|
|
1028
|
+
|
|
1029
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1030
|
+
- DefaultAzureCredential not configured
|
|
1031
|
+
- Insufficient permissions
|
|
1032
|
+
- Expired authentication token
|
|
1033
|
+
|
|
1034
|
+
HTTPError: When Purview API returns error:
|
|
1035
|
+
- 400: Bad request (invalid parameters)
|
|
1036
|
+
- 401: Unauthorized (authentication failed)
|
|
1037
|
+
- 403: Forbidden (insufficient permissions)
|
|
1038
|
+
- 404: Resource not found
|
|
1039
|
+
- 429: Rate limit exceeded
|
|
1040
|
+
- 500: Internal server error
|
|
1041
|
+
|
|
1042
|
+
NetworkError: When network connectivity fails
|
|
1043
|
+
|
|
1044
|
+
Example:
|
|
1045
|
+
# Basic usage
|
|
1046
|
+
client = Management()
|
|
1047
|
+
|
|
1048
|
+
result = client.managementGetAccountFeatures(args=...)
|
|
1049
|
+
print(f"Result: {result}")
|
|
1050
|
+
|
|
1051
|
+
Use Cases:
|
|
1052
|
+
- Data Discovery: Find and explore data assets
|
|
1053
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1054
|
+
- Reporting: Generate catalog reports
|
|
1055
|
+
"""
|
|
1056
|
+
self.method = 'GET'
|
|
1057
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['account_features'],
|
|
1058
|
+
subscriptionId=args["--subscriptionId"],
|
|
1059
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1060
|
+
accountName=args["--accountName"])
|
|
1061
|
+
self.params = get_api_version_params('account')
|
|
1062
|
+
|
|
1063
|
+
@decorator
|
|
1064
|
+
def managementUpdateAccountFeatures(self, args):
|
|
1065
|
+
"""
|
|
1066
|
+
Update an existing management resource.
|
|
1067
|
+
|
|
1068
|
+
Updates an existing management resource with new values.
|
|
1069
|
+
Only specified fields are modified; others remain unchanged.
|
|
1070
|
+
|
|
1071
|
+
Args:
|
|
1072
|
+
args: Dictionary of operation arguments.
|
|
1073
|
+
Contains operation-specific parameters.
|
|
1074
|
+
See method implementation for details.
|
|
1075
|
+
|
|
1076
|
+
Returns:
|
|
1077
|
+
Dictionary containing updated management resource:
|
|
1078
|
+
{
|
|
1079
|
+
'guid': str, # Unique identifier
|
|
1080
|
+
'attributes': dict, # Updated attributes
|
|
1081
|
+
'updateTime': int # Update timestamp
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
Raises:
|
|
1085
|
+
ValueError: When required parameters are missing or invalid:
|
|
1086
|
+
- Empty or None values for required fields
|
|
1087
|
+
- Invalid GUID format
|
|
1088
|
+
- Out-of-range values
|
|
1089
|
+
|
|
1090
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1091
|
+
- DefaultAzureCredential not configured
|
|
1092
|
+
- Insufficient permissions
|
|
1093
|
+
- Expired authentication token
|
|
1094
|
+
|
|
1095
|
+
HTTPError: When Purview API returns error:
|
|
1096
|
+
- 400: Bad request (invalid parameters)
|
|
1097
|
+
- 401: Unauthorized (authentication failed)
|
|
1098
|
+
- 403: Forbidden (insufficient permissions)
|
|
1099
|
+
- 404: Resource not found
|
|
1100
|
+
- 429: Rate limit exceeded
|
|
1101
|
+
- 500: Internal server error
|
|
1102
|
+
|
|
1103
|
+
NetworkError: When network connectivity fails
|
|
1104
|
+
|
|
1105
|
+
Example:
|
|
1106
|
+
# Basic usage
|
|
1107
|
+
client = Management()
|
|
1108
|
+
|
|
1109
|
+
result = client.managementUpdateAccountFeatures(args=...)
|
|
1110
|
+
print(f"Result: {result}")
|
|
1111
|
+
|
|
1112
|
+
# With detailed data
|
|
1113
|
+
data = {
|
|
1114
|
+
'name': 'My Resource',
|
|
1115
|
+
'description': 'Resource description',
|
|
1116
|
+
'attributes': {
|
|
1117
|
+
'key1': 'value1',
|
|
1118
|
+
'key2': 'value2'
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
result = client.managementUpdateAccountFeatures(data)
|
|
1123
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1124
|
+
|
|
1125
|
+
Use Cases:
|
|
1126
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
1127
|
+
- Ownership Changes: Reassign data ownership
|
|
1128
|
+
- Classification: Apply or modify data classifications
|
|
1129
|
+
"""
|
|
1130
|
+
self.method = 'PUT'
|
|
1131
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['account_features'],
|
|
1132
|
+
subscriptionId=args["--subscriptionId"],
|
|
1133
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1134
|
+
accountName=args["--accountName"])
|
|
1135
|
+
self.params = get_api_version_params('account')
|
|
1136
|
+
self.payload = get_json(args, '--payloadFile')
|
|
1137
|
+
|
|
1138
|
+
# ========== Account Ingestion Operations ==========
|
|
1139
|
+
|
|
1140
|
+
@decorator
|
|
1141
|
+
def managementGetIngestionStatus(self, args):
|
|
1142
|
+
"""
|
|
1143
|
+
Retrieve management resource information.
|
|
1144
|
+
|
|
1145
|
+
Retrieves detailed information about the specified management resource.
|
|
1146
|
+
Returns complete management resource metadata and properties.
|
|
1147
|
+
|
|
1148
|
+
Args:
|
|
1149
|
+
args: Dictionary of operation arguments.
|
|
1150
|
+
Contains operation-specific parameters.
|
|
1151
|
+
See method implementation for details.
|
|
1152
|
+
|
|
1153
|
+
Returns:
|
|
1154
|
+
Dictionary containing management resource information:
|
|
1155
|
+
{
|
|
1156
|
+
'guid': str, # Unique identifier
|
|
1157
|
+
'name': str, # Resource name
|
|
1158
|
+
'attributes': dict, # Resource attributes
|
|
1159
|
+
'status': str, # Resource status
|
|
1160
|
+
'updateTime': int # Last update timestamp
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
Raises:
|
|
1164
|
+
ValueError: When required parameters are missing or invalid:
|
|
1165
|
+
- Empty or None values for required fields
|
|
1166
|
+
- Invalid GUID format
|
|
1167
|
+
- Out-of-range values
|
|
1168
|
+
|
|
1169
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1170
|
+
- DefaultAzureCredential not configured
|
|
1171
|
+
- Insufficient permissions
|
|
1172
|
+
- Expired authentication token
|
|
1173
|
+
|
|
1174
|
+
HTTPError: When Purview API returns error:
|
|
1175
|
+
- 400: Bad request (invalid parameters)
|
|
1176
|
+
- 401: Unauthorized (authentication failed)
|
|
1177
|
+
- 403: Forbidden (insufficient permissions)
|
|
1178
|
+
- 404: Resource not found
|
|
1179
|
+
- 429: Rate limit exceeded
|
|
1180
|
+
- 500: Internal server error
|
|
1181
|
+
|
|
1182
|
+
NetworkError: When network connectivity fails
|
|
1183
|
+
|
|
1184
|
+
Example:
|
|
1185
|
+
# Basic usage
|
|
1186
|
+
client = Management()
|
|
1187
|
+
|
|
1188
|
+
result = client.managementGetIngestionStatus(args=...)
|
|
1189
|
+
print(f"Result: {result}")
|
|
1190
|
+
|
|
1191
|
+
Use Cases:
|
|
1192
|
+
- Data Discovery: Find and explore data assets
|
|
1193
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1194
|
+
- Reporting: Generate catalog reports
|
|
1195
|
+
"""
|
|
1196
|
+
self.method = 'GET'
|
|
1197
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['ingestion_status'],
|
|
1198
|
+
subscriptionId=args["--subscriptionId"],
|
|
1199
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1200
|
+
accountName=args["--accountName"])
|
|
1201
|
+
self.params = get_api_version_params('account')
|
|
1202
|
+
|
|
1203
|
+
@decorator
|
|
1204
|
+
def managementListResourceSets(self, args):
|
|
1205
|
+
"""
|
|
1206
|
+
Retrieve management resource information.
|
|
1207
|
+
|
|
1208
|
+
Retrieves detailed information about the specified management resource.
|
|
1209
|
+
Returns complete management resource metadata and properties.
|
|
1210
|
+
|
|
1211
|
+
Args:
|
|
1212
|
+
args: Dictionary of operation arguments.
|
|
1213
|
+
Contains operation-specific parameters.
|
|
1214
|
+
See method implementation for details.
|
|
1215
|
+
|
|
1216
|
+
Returns:
|
|
1217
|
+
List of resource dictionaries, each containing:
|
|
1218
|
+
- guid (str): Unique identifier
|
|
1219
|
+
- name (str): Resource name
|
|
1220
|
+
- attributes (dict): Resource attributes
|
|
1221
|
+
- status (str): Resource status
|
|
1222
|
+
|
|
1223
|
+
Returns empty list if no resources found.
|
|
1224
|
+
|
|
1225
|
+
Raises:
|
|
1226
|
+
ValueError: When required parameters are missing or invalid:
|
|
1227
|
+
- Empty or None values for required fields
|
|
1228
|
+
- Invalid GUID format
|
|
1229
|
+
- Out-of-range values
|
|
1230
|
+
|
|
1231
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1232
|
+
- DefaultAzureCredential not configured
|
|
1233
|
+
- Insufficient permissions
|
|
1234
|
+
- Expired authentication token
|
|
1235
|
+
|
|
1236
|
+
HTTPError: When Purview API returns error:
|
|
1237
|
+
- 400: Bad request (invalid parameters)
|
|
1238
|
+
- 401: Unauthorized (authentication failed)
|
|
1239
|
+
- 403: Forbidden (insufficient permissions)
|
|
1240
|
+
- 404: Resource not found
|
|
1241
|
+
- 429: Rate limit exceeded
|
|
1242
|
+
- 500: Internal server error
|
|
1243
|
+
|
|
1244
|
+
NetworkError: When network connectivity fails
|
|
1245
|
+
|
|
1246
|
+
Example:
|
|
1247
|
+
# Basic usage
|
|
1248
|
+
client = Management()
|
|
1249
|
+
|
|
1250
|
+
result = client.managementListResourceSets(args=...)
|
|
1251
|
+
print(f"Result: {result}")
|
|
1252
|
+
|
|
1253
|
+
Use Cases:
|
|
1254
|
+
- Data Discovery: Find and explore data assets
|
|
1255
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1256
|
+
- Reporting: Generate catalog reports
|
|
1257
|
+
"""
|
|
1258
|
+
self.method = 'GET'
|
|
1259
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['resource_sets'],
|
|
1260
|
+
subscriptionId=args["--subscriptionId"],
|
|
1261
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1262
|
+
accountName=args["--accountName"])
|
|
1263
|
+
self.params = get_api_version_params('account')
|
|
1264
|
+
|
|
1265
|
+
# ========== Account Security and Compliance ==========
|
|
1266
|
+
|
|
1267
|
+
@decorator
|
|
1268
|
+
def managementGetSecuritySettings(self, args):
|
|
1269
|
+
"""
|
|
1270
|
+
Retrieve management resource information.
|
|
1271
|
+
|
|
1272
|
+
Retrieves detailed information about the specified management resource.
|
|
1273
|
+
Returns complete management resource metadata and properties.
|
|
1274
|
+
|
|
1275
|
+
Args:
|
|
1276
|
+
args: Dictionary of operation arguments.
|
|
1277
|
+
Contains operation-specific parameters.
|
|
1278
|
+
See method implementation for details.
|
|
1279
|
+
|
|
1280
|
+
Returns:
|
|
1281
|
+
Dictionary containing management resource information:
|
|
1282
|
+
{
|
|
1283
|
+
'guid': str, # Unique identifier
|
|
1284
|
+
'name': str, # Resource name
|
|
1285
|
+
'attributes': dict, # Resource attributes
|
|
1286
|
+
'status': str, # Resource status
|
|
1287
|
+
'updateTime': int # Last update timestamp
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
Raises:
|
|
1291
|
+
ValueError: When required parameters are missing or invalid:
|
|
1292
|
+
- Empty or None values for required fields
|
|
1293
|
+
- Invalid GUID format
|
|
1294
|
+
- Out-of-range values
|
|
1295
|
+
|
|
1296
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1297
|
+
- DefaultAzureCredential not configured
|
|
1298
|
+
- Insufficient permissions
|
|
1299
|
+
- Expired authentication token
|
|
1300
|
+
|
|
1301
|
+
HTTPError: When Purview API returns error:
|
|
1302
|
+
- 400: Bad request (invalid parameters)
|
|
1303
|
+
- 401: Unauthorized (authentication failed)
|
|
1304
|
+
- 403: Forbidden (insufficient permissions)
|
|
1305
|
+
- 404: Resource not found
|
|
1306
|
+
- 429: Rate limit exceeded
|
|
1307
|
+
- 500: Internal server error
|
|
1308
|
+
|
|
1309
|
+
NetworkError: When network connectivity fails
|
|
1310
|
+
|
|
1311
|
+
Example:
|
|
1312
|
+
# Basic usage
|
|
1313
|
+
client = Management()
|
|
1314
|
+
|
|
1315
|
+
result = client.managementGetSecuritySettings(args=...)
|
|
1316
|
+
print(f"Result: {result}")
|
|
1317
|
+
|
|
1318
|
+
Use Cases:
|
|
1319
|
+
- Data Discovery: Find and explore data assets
|
|
1320
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1321
|
+
- Reporting: Generate catalog reports
|
|
1322
|
+
"""
|
|
1323
|
+
self.method = 'GET'
|
|
1324
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['security_settings'],
|
|
1325
|
+
subscriptionId=args["--subscriptionId"],
|
|
1326
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1327
|
+
accountName=args["--accountName"])
|
|
1328
|
+
self.params = get_api_version_params('account')
|
|
1329
|
+
|
|
1330
|
+
@decorator
|
|
1331
|
+
def managementUpdateSecuritySettings(self, args):
|
|
1332
|
+
"""
|
|
1333
|
+
Update an existing management resource.
|
|
1334
|
+
|
|
1335
|
+
Updates an existing management resource with new values.
|
|
1336
|
+
Only specified fields are modified; others remain unchanged.
|
|
1337
|
+
|
|
1338
|
+
Args:
|
|
1339
|
+
args: Dictionary of operation arguments.
|
|
1340
|
+
Contains operation-specific parameters.
|
|
1341
|
+
See method implementation for details.
|
|
1342
|
+
|
|
1343
|
+
Returns:
|
|
1344
|
+
Dictionary containing updated management resource:
|
|
1345
|
+
{
|
|
1346
|
+
'guid': str, # Unique identifier
|
|
1347
|
+
'attributes': dict, # Updated attributes
|
|
1348
|
+
'updateTime': int # Update timestamp
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
Raises:
|
|
1352
|
+
ValueError: When required parameters are missing or invalid:
|
|
1353
|
+
- Empty or None values for required fields
|
|
1354
|
+
- Invalid GUID format
|
|
1355
|
+
- Out-of-range values
|
|
1356
|
+
|
|
1357
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1358
|
+
- DefaultAzureCredential not configured
|
|
1359
|
+
- Insufficient permissions
|
|
1360
|
+
- Expired authentication token
|
|
1361
|
+
|
|
1362
|
+
HTTPError: When Purview API returns error:
|
|
1363
|
+
- 400: Bad request (invalid parameters)
|
|
1364
|
+
- 401: Unauthorized (authentication failed)
|
|
1365
|
+
- 403: Forbidden (insufficient permissions)
|
|
1366
|
+
- 404: Resource not found
|
|
1367
|
+
- 429: Rate limit exceeded
|
|
1368
|
+
- 500: Internal server error
|
|
1369
|
+
|
|
1370
|
+
NetworkError: When network connectivity fails
|
|
1371
|
+
|
|
1372
|
+
Example:
|
|
1373
|
+
# Basic usage
|
|
1374
|
+
client = Management()
|
|
1375
|
+
|
|
1376
|
+
result = client.managementUpdateSecuritySettings(args=...)
|
|
1377
|
+
print(f"Result: {result}")
|
|
1378
|
+
|
|
1379
|
+
# With detailed data
|
|
1380
|
+
data = {
|
|
1381
|
+
'name': 'My Resource',
|
|
1382
|
+
'description': 'Resource description',
|
|
1383
|
+
'attributes': {
|
|
1384
|
+
'key1': 'value1',
|
|
1385
|
+
'key2': 'value2'
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
result = client.managementUpdateSecuritySettings(data)
|
|
1390
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1391
|
+
|
|
1392
|
+
Use Cases:
|
|
1393
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
1394
|
+
- Ownership Changes: Reassign data ownership
|
|
1395
|
+
- Classification: Apply or modify data classifications
|
|
1396
|
+
"""
|
|
1397
|
+
self.method = 'PUT'
|
|
1398
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['security_settings'],
|
|
1399
|
+
subscriptionId=args["--subscriptionId"],
|
|
1400
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1401
|
+
accountName=args["--accountName"])
|
|
1402
|
+
self.params = get_api_version_params('account')
|
|
1403
|
+
self.payload = get_json(args, '--payloadFile')
|
|
1404
|
+
|
|
1405
|
+
# ========== Account Monitoring and Diagnostics ==========
|
|
1406
|
+
|
|
1407
|
+
@decorator
|
|
1408
|
+
def managementGetDiagnosticSettings(self, args):
|
|
1409
|
+
"""
|
|
1410
|
+
Retrieve management resource information.
|
|
1411
|
+
|
|
1412
|
+
Retrieves detailed information about the specified management resource.
|
|
1413
|
+
Returns complete management resource metadata and properties.
|
|
1414
|
+
|
|
1415
|
+
Args:
|
|
1416
|
+
args: Dictionary of operation arguments.
|
|
1417
|
+
Contains operation-specific parameters.
|
|
1418
|
+
See method implementation for details.
|
|
1419
|
+
|
|
1420
|
+
Returns:
|
|
1421
|
+
Dictionary containing management resource information:
|
|
1422
|
+
{
|
|
1423
|
+
'guid': str, # Unique identifier
|
|
1424
|
+
'name': str, # Resource name
|
|
1425
|
+
'attributes': dict, # Resource attributes
|
|
1426
|
+
'status': str, # Resource status
|
|
1427
|
+
'updateTime': int # Last update timestamp
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
Raises:
|
|
1431
|
+
ValueError: When required parameters are missing or invalid:
|
|
1432
|
+
- Empty or None values for required fields
|
|
1433
|
+
- Invalid GUID format
|
|
1434
|
+
- Out-of-range values
|
|
1435
|
+
|
|
1436
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1437
|
+
- DefaultAzureCredential not configured
|
|
1438
|
+
- Insufficient permissions
|
|
1439
|
+
- Expired authentication token
|
|
1440
|
+
|
|
1441
|
+
HTTPError: When Purview API returns error:
|
|
1442
|
+
- 400: Bad request (invalid parameters)
|
|
1443
|
+
- 401: Unauthorized (authentication failed)
|
|
1444
|
+
- 403: Forbidden (insufficient permissions)
|
|
1445
|
+
- 404: Resource not found
|
|
1446
|
+
- 429: Rate limit exceeded
|
|
1447
|
+
- 500: Internal server error
|
|
1448
|
+
|
|
1449
|
+
NetworkError: When network connectivity fails
|
|
1450
|
+
|
|
1451
|
+
Example:
|
|
1452
|
+
# Basic usage
|
|
1453
|
+
client = Management()
|
|
1454
|
+
|
|
1455
|
+
result = client.managementGetDiagnosticSettings(args=...)
|
|
1456
|
+
print(f"Result: {result}")
|
|
1457
|
+
|
|
1458
|
+
Use Cases:
|
|
1459
|
+
- Data Discovery: Find and explore data assets
|
|
1460
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1461
|
+
- Reporting: Generate catalog reports
|
|
1462
|
+
"""
|
|
1463
|
+
self.method = 'GET'
|
|
1464
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['diagnostic_settings'],
|
|
1465
|
+
subscriptionId=args["--subscriptionId"],
|
|
1466
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1467
|
+
accountName=args["--accountName"])
|
|
1468
|
+
self.params = get_api_version_params('account')
|
|
1469
|
+
|
|
1470
|
+
@decorator
|
|
1471
|
+
def managementCreateOrUpdateDiagnosticSettings(self, args):
|
|
1472
|
+
"""
|
|
1473
|
+
Create a new management resource.
|
|
1474
|
+
|
|
1475
|
+
Creates a new management resource in Microsoft Purview.
|
|
1476
|
+
Requires appropriate permissions and valid management resource definition.
|
|
1477
|
+
|
|
1478
|
+
Args:
|
|
1479
|
+
args: Dictionary of operation arguments.
|
|
1480
|
+
Contains operation-specific parameters.
|
|
1481
|
+
See method implementation for details.
|
|
1482
|
+
|
|
1483
|
+
Returns:
|
|
1484
|
+
Dictionary containing created management resource:
|
|
1485
|
+
{
|
|
1486
|
+
'guid': str, # Unique identifier
|
|
1487
|
+
'name': str, # Resource name
|
|
1488
|
+
'status': str, # Creation status
|
|
1489
|
+
'attributes': dict, # Resource attributes
|
|
1490
|
+
'createTime': int # Creation timestamp
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
Raises:
|
|
1494
|
+
ValueError: When required parameters are missing or invalid:
|
|
1495
|
+
- Empty or None values for required fields
|
|
1496
|
+
- Invalid GUID format
|
|
1497
|
+
- Out-of-range values
|
|
1498
|
+
|
|
1499
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1500
|
+
- DefaultAzureCredential not configured
|
|
1501
|
+
- Insufficient permissions
|
|
1502
|
+
- Expired authentication token
|
|
1503
|
+
|
|
1504
|
+
HTTPError: When Purview API returns error:
|
|
1505
|
+
- 400: Bad request (invalid parameters)
|
|
1506
|
+
- 401: Unauthorized (authentication failed)
|
|
1507
|
+
- 403: Forbidden (insufficient permissions)
|
|
1508
|
+
- 404: Resource not found
|
|
1509
|
+
- 409: Conflict (resource already exists)
|
|
1510
|
+
- 429: Rate limit exceeded
|
|
1511
|
+
- 500: Internal server error
|
|
1512
|
+
|
|
1513
|
+
NetworkError: When network connectivity fails
|
|
1514
|
+
|
|
1515
|
+
Example:
|
|
1516
|
+
# Basic usage
|
|
1517
|
+
client = Management()
|
|
1518
|
+
|
|
1519
|
+
result = client.managementCreateOrUpdateDiagnosticSettings(args=...)
|
|
1520
|
+
print(f"Result: {result}")
|
|
1521
|
+
|
|
1522
|
+
# With detailed data
|
|
1523
|
+
data = {
|
|
1524
|
+
'name': 'My Resource',
|
|
1525
|
+
'description': 'Resource description',
|
|
1526
|
+
'attributes': {
|
|
1527
|
+
'key1': 'value1',
|
|
1528
|
+
'key2': 'value2'
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
result = client.managementCreateOrUpdateDiagnosticSettings(data)
|
|
1533
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1534
|
+
|
|
1535
|
+
Use Cases:
|
|
1536
|
+
- Data Onboarding: Register new data sources in catalog
|
|
1537
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
1538
|
+
- Automation: Programmatically populate catalog
|
|
1539
|
+
"""
|
|
1540
|
+
self.method = 'PUT'
|
|
1541
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['diagnostic_setting'],
|
|
1542
|
+
subscriptionId=args["--subscriptionId"],
|
|
1543
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1544
|
+
accountName=args["--accountName"],
|
|
1545
|
+
diagnosticSettingName=args["--diagnosticSettingName"])
|
|
1546
|
+
self.params = get_api_version_params('account')
|
|
1547
|
+
self.payload = get_json(args, '--payloadFile')
|
|
1548
|
+
|
|
1549
|
+
@decorator
|
|
1550
|
+
def managementDeleteDiagnosticSetting(self, args):
|
|
1551
|
+
"""
|
|
1552
|
+
Update an existing management resource.
|
|
1553
|
+
|
|
1554
|
+
Updates an existing management resource with new values.
|
|
1555
|
+
Only specified fields are modified; others remain unchanged.
|
|
1556
|
+
|
|
1557
|
+
Args:
|
|
1558
|
+
args: Dictionary of operation arguments.
|
|
1559
|
+
Contains operation-specific parameters.
|
|
1560
|
+
See method implementation for details.
|
|
1561
|
+
|
|
1562
|
+
Returns:
|
|
1563
|
+
Dictionary containing updated management resource:
|
|
1564
|
+
{
|
|
1565
|
+
'guid': str, # Unique identifier
|
|
1566
|
+
'attributes': dict, # Updated attributes
|
|
1567
|
+
'updateTime': int # Update timestamp
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
Raises:
|
|
1571
|
+
ValueError: When required parameters are missing or invalid:
|
|
1572
|
+
- Empty or None values for required fields
|
|
1573
|
+
- Invalid GUID format
|
|
1574
|
+
- Out-of-range values
|
|
1575
|
+
|
|
1576
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1577
|
+
- DefaultAzureCredential not configured
|
|
1578
|
+
- Insufficient permissions
|
|
1579
|
+
- Expired authentication token
|
|
1580
|
+
|
|
1581
|
+
HTTPError: When Purview API returns error:
|
|
1582
|
+
- 400: Bad request (invalid parameters)
|
|
1583
|
+
- 401: Unauthorized (authentication failed)
|
|
1584
|
+
- 403: Forbidden (insufficient permissions)
|
|
1585
|
+
- 404: Resource not found
|
|
1586
|
+
- 429: Rate limit exceeded
|
|
1587
|
+
- 500: Internal server error
|
|
1588
|
+
|
|
1589
|
+
NetworkError: When network connectivity fails
|
|
1590
|
+
|
|
1591
|
+
Example:
|
|
1592
|
+
# Basic usage
|
|
1593
|
+
client = Management()
|
|
1594
|
+
|
|
1595
|
+
result = client.managementDeleteDiagnosticSetting(args=...)
|
|
1596
|
+
print(f"Result: {result}")
|
|
1597
|
+
|
|
1598
|
+
# With detailed data
|
|
1599
|
+
data = {
|
|
1600
|
+
'name': 'My Resource',
|
|
1601
|
+
'description': 'Resource description',
|
|
1602
|
+
'attributes': {
|
|
1603
|
+
'key1': 'value1',
|
|
1604
|
+
'key2': 'value2'
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
result = client.managementDeleteDiagnosticSetting(data)
|
|
1609
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1610
|
+
|
|
1611
|
+
Use Cases:
|
|
1612
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
1613
|
+
- Ownership Changes: Reassign data ownership
|
|
1614
|
+
- Classification: Apply or modify data classifications
|
|
1615
|
+
"""
|
|
1616
|
+
self.method = 'DELETE'
|
|
1617
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['diagnostic_setting'],
|
|
1618
|
+
subscriptionId=args["--subscriptionId"],
|
|
1619
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1620
|
+
accountName=args["--accountName"],
|
|
1621
|
+
diagnosticSettingName=args["--diagnosticSettingName"])
|
|
1622
|
+
self.params = get_api_version_params('account')
|
|
1623
|
+
|
|
1624
|
+
# ========== Account Usage and Metrics ==========
|
|
1625
|
+
|
|
1626
|
+
@decorator
|
|
1627
|
+
def managementGetAccountUsage(self, args):
|
|
1628
|
+
"""
|
|
1629
|
+
Retrieve management resource information.
|
|
1630
|
+
|
|
1631
|
+
Retrieves detailed information about the specified management resource.
|
|
1632
|
+
Returns complete management resource metadata and properties.
|
|
1633
|
+
|
|
1634
|
+
Args:
|
|
1635
|
+
args: Dictionary of operation arguments.
|
|
1636
|
+
Contains operation-specific parameters.
|
|
1637
|
+
See method implementation for details.
|
|
1638
|
+
|
|
1639
|
+
Returns:
|
|
1640
|
+
Dictionary containing management resource information:
|
|
1641
|
+
{
|
|
1642
|
+
'guid': str, # Unique identifier
|
|
1643
|
+
'name': str, # Resource name
|
|
1644
|
+
'attributes': dict, # Resource attributes
|
|
1645
|
+
'status': str, # Resource status
|
|
1646
|
+
'updateTime': int # Last update timestamp
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
Raises:
|
|
1650
|
+
ValueError: When required parameters are missing or invalid:
|
|
1651
|
+
- Empty or None values for required fields
|
|
1652
|
+
- Invalid GUID format
|
|
1653
|
+
- Out-of-range values
|
|
1654
|
+
|
|
1655
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1656
|
+
- DefaultAzureCredential not configured
|
|
1657
|
+
- Insufficient permissions
|
|
1658
|
+
- Expired authentication token
|
|
1659
|
+
|
|
1660
|
+
HTTPError: When Purview API returns error:
|
|
1661
|
+
- 400: Bad request (invalid parameters)
|
|
1662
|
+
- 401: Unauthorized (authentication failed)
|
|
1663
|
+
- 403: Forbidden (insufficient permissions)
|
|
1664
|
+
- 404: Resource not found
|
|
1665
|
+
- 429: Rate limit exceeded
|
|
1666
|
+
- 500: Internal server error
|
|
1667
|
+
|
|
1668
|
+
NetworkError: When network connectivity fails
|
|
1669
|
+
|
|
1670
|
+
Example:
|
|
1671
|
+
# Basic usage
|
|
1672
|
+
client = Management()
|
|
1673
|
+
|
|
1674
|
+
result = client.managementGetAccountUsage(args=...)
|
|
1675
|
+
print(f"Result: {result}")
|
|
1676
|
+
|
|
1677
|
+
Use Cases:
|
|
1678
|
+
- Data Discovery: Find and explore data assets
|
|
1679
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1680
|
+
- Reporting: Generate catalog reports
|
|
1681
|
+
"""
|
|
1682
|
+
self.method = 'GET'
|
|
1683
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['account_usage'],
|
|
1684
|
+
subscriptionId=args["--subscriptionId"],
|
|
1685
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1686
|
+
accountName=args["--accountName"])
|
|
1687
|
+
self.params = get_api_version_params('account')
|
|
1688
|
+
|
|
1689
|
+
@decorator
|
|
1690
|
+
def managementGetAccountMetrics(self, args):
|
|
1691
|
+
"""
|
|
1692
|
+
Retrieve management resource information.
|
|
1693
|
+
|
|
1694
|
+
Retrieves detailed information about the specified management resource.
|
|
1695
|
+
Returns complete management resource metadata and properties.
|
|
1696
|
+
|
|
1697
|
+
Args:
|
|
1698
|
+
args: Dictionary of operation arguments.
|
|
1699
|
+
Contains operation-specific parameters.
|
|
1700
|
+
See method implementation for details.
|
|
1701
|
+
|
|
1702
|
+
Returns:
|
|
1703
|
+
Dictionary containing management resource information:
|
|
1704
|
+
{
|
|
1705
|
+
'guid': str, # Unique identifier
|
|
1706
|
+
'name': str, # Resource name
|
|
1707
|
+
'attributes': dict, # Resource attributes
|
|
1708
|
+
'status': str, # Resource status
|
|
1709
|
+
'updateTime': int # Last update timestamp
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
Raises:
|
|
1713
|
+
ValueError: When required parameters are missing or invalid:
|
|
1714
|
+
- Empty or None values for required fields
|
|
1715
|
+
- Invalid GUID format
|
|
1716
|
+
- Out-of-range values
|
|
1717
|
+
|
|
1718
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1719
|
+
- DefaultAzureCredential not configured
|
|
1720
|
+
- Insufficient permissions
|
|
1721
|
+
- Expired authentication token
|
|
1722
|
+
|
|
1723
|
+
HTTPError: When Purview API returns error:
|
|
1724
|
+
- 400: Bad request (invalid parameters)
|
|
1725
|
+
- 401: Unauthorized (authentication failed)
|
|
1726
|
+
- 403: Forbidden (insufficient permissions)
|
|
1727
|
+
- 404: Resource not found
|
|
1728
|
+
- 429: Rate limit exceeded
|
|
1729
|
+
- 500: Internal server error
|
|
1730
|
+
|
|
1731
|
+
NetworkError: When network connectivity fails
|
|
1732
|
+
|
|
1733
|
+
Example:
|
|
1734
|
+
# Basic usage
|
|
1735
|
+
client = Management()
|
|
1736
|
+
|
|
1737
|
+
result = client.managementGetAccountMetrics(args=...)
|
|
1738
|
+
print(f"Result: {result}")
|
|
1739
|
+
|
|
1740
|
+
Use Cases:
|
|
1741
|
+
- Data Discovery: Find and explore data assets
|
|
1742
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1743
|
+
- Reporting: Generate catalog reports
|
|
1744
|
+
"""
|
|
1745
|
+
self.method = 'GET'
|
|
1746
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['account_metrics'],
|
|
1747
|
+
subscriptionId=args["--subscriptionId"],
|
|
1748
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1749
|
+
accountName=args["--accountName"])
|
|
1750
|
+
self.params = get_api_version_params('account')
|
|
1751
|
+
if args.get('--timespan'):
|
|
1752
|
+
self.params['timespan'] = args['--timespan']
|
|
1753
|
+
if args.get('--metricNames'):
|
|
1754
|
+
self.params['metricnames'] = args['--metricNames']
|
|
1755
|
+
|
|
1756
|
+
# ========== Account Tags and Metadata ==========
|
|
1757
|
+
|
|
1758
|
+
@decorator
|
|
1759
|
+
def managementGetAccountTags(self, args):
|
|
1760
|
+
"""
|
|
1761
|
+
Retrieve management resource information.
|
|
1762
|
+
|
|
1763
|
+
Retrieves detailed information about the specified management resource.
|
|
1764
|
+
Returns complete management resource metadata and properties.
|
|
1765
|
+
|
|
1766
|
+
Args:
|
|
1767
|
+
args: Dictionary of operation arguments.
|
|
1768
|
+
Contains operation-specific parameters.
|
|
1769
|
+
See method implementation for details.
|
|
1770
|
+
|
|
1771
|
+
Returns:
|
|
1772
|
+
Dictionary containing management resource information:
|
|
1773
|
+
{
|
|
1774
|
+
'guid': str, # Unique identifier
|
|
1775
|
+
'name': str, # Resource name
|
|
1776
|
+
'attributes': dict, # Resource attributes
|
|
1777
|
+
'status': str, # Resource status
|
|
1778
|
+
'updateTime': int # Last update timestamp
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
Raises:
|
|
1782
|
+
ValueError: When required parameters are missing or invalid:
|
|
1783
|
+
- Empty or None values for required fields
|
|
1784
|
+
- Invalid GUID format
|
|
1785
|
+
- Out-of-range values
|
|
1786
|
+
|
|
1787
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1788
|
+
- DefaultAzureCredential not configured
|
|
1789
|
+
- Insufficient permissions
|
|
1790
|
+
- Expired authentication token
|
|
1791
|
+
|
|
1792
|
+
HTTPError: When Purview API returns error:
|
|
1793
|
+
- 400: Bad request (invalid parameters)
|
|
1794
|
+
- 401: Unauthorized (authentication failed)
|
|
1795
|
+
- 403: Forbidden (insufficient permissions)
|
|
1796
|
+
- 404: Resource not found
|
|
1797
|
+
- 429: Rate limit exceeded
|
|
1798
|
+
- 500: Internal server error
|
|
1799
|
+
|
|
1800
|
+
NetworkError: When network connectivity fails
|
|
1801
|
+
|
|
1802
|
+
Example:
|
|
1803
|
+
# Basic usage
|
|
1804
|
+
client = Management()
|
|
1805
|
+
|
|
1806
|
+
result = client.managementGetAccountTags(args=...)
|
|
1807
|
+
print(f"Result: {result}")
|
|
1808
|
+
|
|
1809
|
+
Use Cases:
|
|
1810
|
+
- Data Discovery: Find and explore data assets
|
|
1811
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1812
|
+
- Reporting: Generate catalog reports
|
|
1813
|
+
"""
|
|
1814
|
+
self.method = 'GET'
|
|
1815
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['account_tags'],
|
|
1816
|
+
subscriptionId=args["--subscriptionId"],
|
|
1817
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1818
|
+
accountName=args["--accountName"])
|
|
1819
|
+
self.params = get_api_version_params('account')
|
|
1820
|
+
|
|
1821
|
+
@decorator
|
|
1822
|
+
def managementUpdateAccountTags(self, args):
|
|
1823
|
+
"""
|
|
1824
|
+
Update an existing management resource.
|
|
1825
|
+
|
|
1826
|
+
Updates an existing management resource with new values.
|
|
1827
|
+
Only specified fields are modified; others remain unchanged.
|
|
1828
|
+
|
|
1829
|
+
Args:
|
|
1830
|
+
args: Dictionary of operation arguments.
|
|
1831
|
+
Contains operation-specific parameters.
|
|
1832
|
+
See method implementation for details.
|
|
1833
|
+
|
|
1834
|
+
Returns:
|
|
1835
|
+
Dictionary containing updated management resource:
|
|
1836
|
+
{
|
|
1837
|
+
'guid': str, # Unique identifier
|
|
1838
|
+
'attributes': dict, # Updated attributes
|
|
1839
|
+
'updateTime': int # Update timestamp
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
Raises:
|
|
1843
|
+
ValueError: When required parameters are missing or invalid:
|
|
1844
|
+
- Empty or None values for required fields
|
|
1845
|
+
- Invalid GUID format
|
|
1846
|
+
- Out-of-range values
|
|
1847
|
+
|
|
1848
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1849
|
+
- DefaultAzureCredential not configured
|
|
1850
|
+
- Insufficient permissions
|
|
1851
|
+
- Expired authentication token
|
|
1852
|
+
|
|
1853
|
+
HTTPError: When Purview API returns error:
|
|
1854
|
+
- 400: Bad request (invalid parameters)
|
|
1855
|
+
- 401: Unauthorized (authentication failed)
|
|
1856
|
+
- 403: Forbidden (insufficient permissions)
|
|
1857
|
+
- 404: Resource not found
|
|
1858
|
+
- 429: Rate limit exceeded
|
|
1859
|
+
- 500: Internal server error
|
|
1860
|
+
|
|
1861
|
+
NetworkError: When network connectivity fails
|
|
1862
|
+
|
|
1863
|
+
Example:
|
|
1864
|
+
# Basic usage
|
|
1865
|
+
client = Management()
|
|
1866
|
+
|
|
1867
|
+
result = client.managementUpdateAccountTags(args=...)
|
|
1868
|
+
print(f"Result: {result}")
|
|
1869
|
+
|
|
1870
|
+
# With detailed data
|
|
1871
|
+
data = {
|
|
1872
|
+
'name': 'My Resource',
|
|
1873
|
+
'description': 'Resource description',
|
|
1874
|
+
'attributes': {
|
|
1875
|
+
'key1': 'value1',
|
|
1876
|
+
'key2': 'value2'
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
result = client.managementUpdateAccountTags(data)
|
|
1881
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1882
|
+
|
|
1883
|
+
Use Cases:
|
|
1884
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
1885
|
+
- Ownership Changes: Reassign data ownership
|
|
1886
|
+
- Classification: Apply or modify data classifications
|
|
1887
|
+
"""
|
|
1888
|
+
self.method = 'PATCH'
|
|
1889
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['account'],
|
|
1890
|
+
subscriptionId=args["--subscriptionId"],
|
|
1891
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
1892
|
+
accountName=args["--accountName"])
|
|
1893
|
+
self.params = get_api_version_params('account')
|
|
1894
|
+
self.payload = {'tags': get_json(args, '--tagsFile')}
|
|
1895
|
+
|
|
1896
|
+
# ========== Subscription and Tenant Operations ==========
|
|
1897
|
+
|
|
1898
|
+
@decorator
|
|
1899
|
+
def managementListAccountsBySubscription(self, args):
|
|
1900
|
+
"""
|
|
1901
|
+
Retrieve management resource information.
|
|
1902
|
+
|
|
1903
|
+
Retrieves detailed information about the specified management resource.
|
|
1904
|
+
Returns complete management resource metadata and properties.
|
|
1905
|
+
|
|
1906
|
+
Args:
|
|
1907
|
+
args: Dictionary of operation arguments.
|
|
1908
|
+
Contains operation-specific parameters.
|
|
1909
|
+
See method implementation for details.
|
|
1910
|
+
|
|
1911
|
+
Returns:
|
|
1912
|
+
List of resource dictionaries, each containing:
|
|
1913
|
+
- guid (str): Unique identifier
|
|
1914
|
+
- name (str): Resource name
|
|
1915
|
+
- attributes (dict): Resource attributes
|
|
1916
|
+
- status (str): Resource status
|
|
1917
|
+
|
|
1918
|
+
Returns empty list if no resources found.
|
|
1919
|
+
|
|
1920
|
+
Raises:
|
|
1921
|
+
ValueError: When required parameters are missing or invalid:
|
|
1922
|
+
- Empty or None values for required fields
|
|
1923
|
+
- Invalid GUID format
|
|
1924
|
+
- Out-of-range values
|
|
1925
|
+
|
|
1926
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1927
|
+
- DefaultAzureCredential not configured
|
|
1928
|
+
- Insufficient permissions
|
|
1929
|
+
- Expired authentication token
|
|
1930
|
+
|
|
1931
|
+
HTTPError: When Purview API returns error:
|
|
1932
|
+
- 400: Bad request (invalid parameters)
|
|
1933
|
+
- 401: Unauthorized (authentication failed)
|
|
1934
|
+
- 403: Forbidden (insufficient permissions)
|
|
1935
|
+
- 404: Resource not found
|
|
1936
|
+
- 429: Rate limit exceeded
|
|
1937
|
+
- 500: Internal server error
|
|
1938
|
+
|
|
1939
|
+
NetworkError: When network connectivity fails
|
|
1940
|
+
|
|
1941
|
+
Example:
|
|
1942
|
+
# Basic usage
|
|
1943
|
+
client = Management()
|
|
1944
|
+
|
|
1945
|
+
result = client.managementListAccountsBySubscription(args=...)
|
|
1946
|
+
print(f"Result: {result}")
|
|
1947
|
+
|
|
1948
|
+
Use Cases:
|
|
1949
|
+
- Data Discovery: Find and explore data assets
|
|
1950
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1951
|
+
- Reporting: Generate catalog reports
|
|
1952
|
+
"""
|
|
1953
|
+
self.method = 'GET'
|
|
1954
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['accounts'],
|
|
1955
|
+
subscriptionId=args["--subscriptionId"])
|
|
1956
|
+
self.params = get_api_version_params('account')
|
|
1957
|
+
|
|
1958
|
+
@decorator
|
|
1959
|
+
def managementGetSubscriptionUsage(self, args):
|
|
1960
|
+
"""
|
|
1961
|
+
Retrieve management resource information.
|
|
1962
|
+
|
|
1963
|
+
Retrieves detailed information about the specified management resource.
|
|
1964
|
+
Returns complete management resource metadata and properties.
|
|
1965
|
+
|
|
1966
|
+
Args:
|
|
1967
|
+
args: Dictionary of operation arguments.
|
|
1968
|
+
Contains operation-specific parameters.
|
|
1969
|
+
See method implementation for details.
|
|
1970
|
+
|
|
1971
|
+
Returns:
|
|
1972
|
+
Dictionary containing management resource information:
|
|
1973
|
+
{
|
|
1974
|
+
'guid': str, # Unique identifier
|
|
1975
|
+
'name': str, # Resource name
|
|
1976
|
+
'attributes': dict, # Resource attributes
|
|
1977
|
+
'status': str, # Resource status
|
|
1978
|
+
'updateTime': int # Last update timestamp
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
Raises:
|
|
1982
|
+
ValueError: When required parameters are missing or invalid:
|
|
1983
|
+
- Empty or None values for required fields
|
|
1984
|
+
- Invalid GUID format
|
|
1985
|
+
- Out-of-range values
|
|
1986
|
+
|
|
1987
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1988
|
+
- DefaultAzureCredential not configured
|
|
1989
|
+
- Insufficient permissions
|
|
1990
|
+
- Expired authentication token
|
|
1991
|
+
|
|
1992
|
+
HTTPError: When Purview API returns error:
|
|
1993
|
+
- 400: Bad request (invalid parameters)
|
|
1994
|
+
- 401: Unauthorized (authentication failed)
|
|
1995
|
+
- 403: Forbidden (insufficient permissions)
|
|
1996
|
+
- 404: Resource not found
|
|
1997
|
+
- 429: Rate limit exceeded
|
|
1998
|
+
- 500: Internal server error
|
|
1999
|
+
|
|
2000
|
+
NetworkError: When network connectivity fails
|
|
2001
|
+
|
|
2002
|
+
Example:
|
|
2003
|
+
# Basic usage
|
|
2004
|
+
client = Management()
|
|
2005
|
+
|
|
2006
|
+
result = client.managementGetSubscriptionUsage(args=...)
|
|
2007
|
+
print(f"Result: {result}")
|
|
2008
|
+
|
|
2009
|
+
Use Cases:
|
|
2010
|
+
- Data Discovery: Find and explore data assets
|
|
2011
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2012
|
+
- Reporting: Generate catalog reports
|
|
2013
|
+
"""
|
|
2014
|
+
self.method = 'GET'
|
|
2015
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['subscription_usage'],
|
|
2016
|
+
subscriptionId=args["--subscriptionId"])
|
|
2017
|
+
self.params = get_api_version_params('account')
|
|
2018
|
+
|
|
2019
|
+
# ========== Advanced Management Operations ==========
|
|
2020
|
+
|
|
2021
|
+
@decorator
|
|
2022
|
+
def managementGetAccountStatus(self, args):
|
|
2023
|
+
"""
|
|
2024
|
+
Retrieve management resource information.
|
|
2025
|
+
|
|
2026
|
+
Retrieves detailed information about the specified management resource.
|
|
2027
|
+
Returns complete management resource metadata and properties.
|
|
2028
|
+
|
|
2029
|
+
Args:
|
|
2030
|
+
args: Dictionary of operation arguments.
|
|
2031
|
+
Contains operation-specific parameters.
|
|
2032
|
+
See method implementation for details.
|
|
2033
|
+
|
|
2034
|
+
Returns:
|
|
2035
|
+
Dictionary containing management resource information:
|
|
2036
|
+
{
|
|
2037
|
+
'guid': str, # Unique identifier
|
|
2038
|
+
'name': str, # Resource name
|
|
2039
|
+
'attributes': dict, # Resource attributes
|
|
2040
|
+
'status': str, # Resource status
|
|
2041
|
+
'updateTime': int # Last update timestamp
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
Raises:
|
|
2045
|
+
ValueError: When required parameters are missing or invalid:
|
|
2046
|
+
- Empty or None values for required fields
|
|
2047
|
+
- Invalid GUID format
|
|
2048
|
+
- Out-of-range values
|
|
2049
|
+
|
|
2050
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2051
|
+
- DefaultAzureCredential not configured
|
|
2052
|
+
- Insufficient permissions
|
|
2053
|
+
- Expired authentication token
|
|
2054
|
+
|
|
2055
|
+
HTTPError: When Purview API returns error:
|
|
2056
|
+
- 400: Bad request (invalid parameters)
|
|
2057
|
+
- 401: Unauthorized (authentication failed)
|
|
2058
|
+
- 403: Forbidden (insufficient permissions)
|
|
2059
|
+
- 404: Resource not found
|
|
2060
|
+
- 429: Rate limit exceeded
|
|
2061
|
+
- 500: Internal server error
|
|
2062
|
+
|
|
2063
|
+
NetworkError: When network connectivity fails
|
|
2064
|
+
|
|
2065
|
+
Example:
|
|
2066
|
+
# Basic usage
|
|
2067
|
+
client = Management()
|
|
2068
|
+
|
|
2069
|
+
result = client.managementGetAccountStatus(args=...)
|
|
2070
|
+
print(f"Result: {result}")
|
|
2071
|
+
|
|
2072
|
+
Use Cases:
|
|
2073
|
+
- Data Discovery: Find and explore data assets
|
|
2074
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2075
|
+
- Reporting: Generate catalog reports
|
|
2076
|
+
"""
|
|
2077
|
+
self.method = 'GET'
|
|
2078
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['account_status'],
|
|
2079
|
+
subscriptionId=args["--subscriptionId"],
|
|
2080
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
2081
|
+
accountName=args["--accountName"])
|
|
2082
|
+
self.params = get_api_version_params('account')
|
|
2083
|
+
|
|
2084
|
+
@decorator
|
|
2085
|
+
def managementValidateAccountConfiguration(self, args):
|
|
2086
|
+
"""
|
|
2087
|
+
Perform operation on resource.
|
|
2088
|
+
|
|
2089
|
+
|
|
2090
|
+
|
|
2091
|
+
Args:
|
|
2092
|
+
args: Dictionary of operation arguments.
|
|
2093
|
+
Contains operation-specific parameters.
|
|
2094
|
+
See method implementation for details.
|
|
2095
|
+
|
|
2096
|
+
Returns:
|
|
2097
|
+
[TODO: Specify return type and structure]
|
|
2098
|
+
[TODO: Document nested fields]
|
|
2099
|
+
|
|
2100
|
+
Raises:
|
|
2101
|
+
ValueError: When required parameters are missing or invalid:
|
|
2102
|
+
- Empty or None values for required fields
|
|
2103
|
+
- Invalid GUID format
|
|
2104
|
+
- Out-of-range values
|
|
2105
|
+
|
|
2106
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2107
|
+
- DefaultAzureCredential not configured
|
|
2108
|
+
- Insufficient permissions
|
|
2109
|
+
- Expired authentication token
|
|
2110
|
+
|
|
2111
|
+
HTTPError: When Purview API returns error:
|
|
2112
|
+
- 400: Bad request (invalid parameters)
|
|
2113
|
+
- 401: Unauthorized (authentication failed)
|
|
2114
|
+
- 403: Forbidden (insufficient permissions)
|
|
2115
|
+
- 404: Resource not found
|
|
2116
|
+
- 429: Rate limit exceeded
|
|
2117
|
+
- 500: Internal server error
|
|
2118
|
+
|
|
2119
|
+
NetworkError: When network connectivity fails
|
|
2120
|
+
|
|
2121
|
+
Example:
|
|
2122
|
+
# Basic usage
|
|
2123
|
+
client = Management()
|
|
2124
|
+
|
|
2125
|
+
result = client.managementValidateAccountConfiguration(args=...)
|
|
2126
|
+
print(f"Result: {result}")
|
|
2127
|
+
|
|
2128
|
+
Use Cases:
|
|
2129
|
+
- [TODO: Add specific use cases for this operation]
|
|
2130
|
+
- [TODO: Include business context]
|
|
2131
|
+
- [TODO: Explain when to use this method]
|
|
2132
|
+
"""
|
|
2133
|
+
self.method = 'POST'
|
|
2134
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['validate_configuration'],
|
|
2135
|
+
subscriptionId=args["--subscriptionId"],
|
|
2136
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
2137
|
+
accountName=args["--accountName"])
|
|
2138
|
+
self.params = get_api_version_params('account')
|
|
2139
|
+
self.payload = get_json(args, '--payloadFile')
|
|
2140
|
+
|
|
2141
|
+
@decorator
|
|
2142
|
+
def managementGetAccountHealth(self, args):
|
|
2143
|
+
"""
|
|
2144
|
+
Retrieve management resource information.
|
|
2145
|
+
|
|
2146
|
+
Retrieves detailed information about the specified management resource.
|
|
2147
|
+
Returns complete management resource metadata and properties.
|
|
2148
|
+
|
|
2149
|
+
Args:
|
|
2150
|
+
args: Dictionary of operation arguments.
|
|
2151
|
+
Contains operation-specific parameters.
|
|
2152
|
+
See method implementation for details.
|
|
2153
|
+
|
|
2154
|
+
Returns:
|
|
2155
|
+
Dictionary containing management resource information:
|
|
2156
|
+
{
|
|
2157
|
+
'guid': str, # Unique identifier
|
|
2158
|
+
'name': str, # Resource name
|
|
2159
|
+
'attributes': dict, # Resource attributes
|
|
2160
|
+
'status': str, # Resource status
|
|
2161
|
+
'updateTime': int # Last update timestamp
|
|
2162
|
+
}
|
|
2163
|
+
|
|
2164
|
+
Raises:
|
|
2165
|
+
ValueError: When required parameters are missing or invalid:
|
|
2166
|
+
- Empty or None values for required fields
|
|
2167
|
+
- Invalid GUID format
|
|
2168
|
+
- Out-of-range values
|
|
2169
|
+
|
|
2170
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2171
|
+
- DefaultAzureCredential not configured
|
|
2172
|
+
- Insufficient permissions
|
|
2173
|
+
- Expired authentication token
|
|
2174
|
+
|
|
2175
|
+
HTTPError: When Purview API returns error:
|
|
2176
|
+
- 400: Bad request (invalid parameters)
|
|
2177
|
+
- 401: Unauthorized (authentication failed)
|
|
2178
|
+
- 403: Forbidden (insufficient permissions)
|
|
2179
|
+
- 404: Resource not found
|
|
2180
|
+
- 429: Rate limit exceeded
|
|
2181
|
+
- 500: Internal server error
|
|
2182
|
+
|
|
2183
|
+
NetworkError: When network connectivity fails
|
|
2184
|
+
|
|
2185
|
+
Example:
|
|
2186
|
+
# Basic usage
|
|
2187
|
+
client = Management()
|
|
2188
|
+
|
|
2189
|
+
result = client.managementGetAccountHealth(args=...)
|
|
2190
|
+
print(f"Result: {result}")
|
|
2191
|
+
|
|
2192
|
+
Use Cases:
|
|
2193
|
+
- Data Discovery: Find and explore data assets
|
|
2194
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2195
|
+
- Reporting: Generate catalog reports
|
|
2196
|
+
"""
|
|
2197
|
+
self.method = 'GET'
|
|
2198
|
+
self.endpoint = format_endpoint(ENDPOINTS['management']['account_health'],
|
|
2199
|
+
subscriptionId=args["--subscriptionId"],
|
|
2200
|
+
resourceGroupName=args["--resourceGroupName"],
|
|
2201
|
+
accountName=args["--accountName"])
|
|
2202
|
+
self.params = get_api_version_params('account')
|