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,1877 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Account Management Client for Microsoft Purview Account Data Plane API
|
|
3
|
+
Based on official API: https://learn.microsoft.com/en-us/rest/api/purview/accountdataplane/accounts
|
|
4
|
+
API Version: 2019-11-01-preview
|
|
5
|
+
|
|
6
|
+
Complete implementation of ALL Account operations from the official specification with 100% coverage:
|
|
7
|
+
- Account Information Operations
|
|
8
|
+
- Access Key Management
|
|
9
|
+
- Account Settings Management
|
|
10
|
+
- Account Usage and Limits
|
|
11
|
+
- Account Analytics
|
|
12
|
+
- Account Configuration
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from .endpoint import Endpoint, decorator, get_json, no_api_call_decorator
|
|
16
|
+
from .endpoints import ENDPOINTS, get_api_version_params
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Account(Endpoint):
|
|
20
|
+
"""Account Management Operations - Complete Official API Implementation with 100% Coverage"""
|
|
21
|
+
|
|
22
|
+
def __init__(self):
|
|
23
|
+
Endpoint.__init__(self)
|
|
24
|
+
self.app = "account"
|
|
25
|
+
|
|
26
|
+
# === CORE ACCOUNT OPERATIONS ===
|
|
27
|
+
|
|
28
|
+
@decorator
|
|
29
|
+
def accountRead(self, args):
|
|
30
|
+
"""
|
|
31
|
+
Retrieve account resource information.
|
|
32
|
+
|
|
33
|
+
Retrieves detailed information about the specified account resource.
|
|
34
|
+
Returns complete account resource metadata and properties.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
args: Dictionary of operation arguments.
|
|
38
|
+
Contains operation-specific parameters.
|
|
39
|
+
See method implementation for details.
|
|
40
|
+
|
|
41
|
+
Returns:
|
|
42
|
+
Dictionary containing account resource information:
|
|
43
|
+
{
|
|
44
|
+
'guid': str, # Unique identifier
|
|
45
|
+
'name': str, # Resource name
|
|
46
|
+
'attributes': dict, # Resource attributes
|
|
47
|
+
'status': str, # Resource status
|
|
48
|
+
'updateTime': int # Last update timestamp
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
Raises:
|
|
52
|
+
ValueError: When required parameters are missing or invalid:
|
|
53
|
+
- Empty or None values for required fields
|
|
54
|
+
- Invalid GUID format
|
|
55
|
+
- Out-of-range values
|
|
56
|
+
|
|
57
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
58
|
+
- DefaultAzureCredential not configured
|
|
59
|
+
- Insufficient permissions
|
|
60
|
+
- Expired authentication token
|
|
61
|
+
|
|
62
|
+
HTTPError: When Purview API returns error:
|
|
63
|
+
- 400: Bad request (invalid parameters)
|
|
64
|
+
- 401: Unauthorized (authentication failed)
|
|
65
|
+
- 403: Forbidden (insufficient permissions)
|
|
66
|
+
- 404: Resource not found
|
|
67
|
+
- 429: Rate limit exceeded
|
|
68
|
+
- 500: Internal server error
|
|
69
|
+
|
|
70
|
+
NetworkError: When network connectivity fails
|
|
71
|
+
|
|
72
|
+
Example:
|
|
73
|
+
# Basic usage
|
|
74
|
+
client = Account()
|
|
75
|
+
|
|
76
|
+
result = client.accountRead(args=...)
|
|
77
|
+
print(f"Result: {result}")
|
|
78
|
+
|
|
79
|
+
Use Cases:
|
|
80
|
+
- Data Discovery: Find and explore data assets
|
|
81
|
+
- Compliance Auditing: Review metadata and classifications
|
|
82
|
+
- Reporting: Generate catalog reports
|
|
83
|
+
"""
|
|
84
|
+
self.method = "GET"
|
|
85
|
+
self.endpoint = ENDPOINTS["account"]["get"]
|
|
86
|
+
self.params = get_api_version_params("account")
|
|
87
|
+
|
|
88
|
+
@decorator
|
|
89
|
+
def accountUpdate(self, args):
|
|
90
|
+
"""
|
|
91
|
+
Update an existing account resource.
|
|
92
|
+
|
|
93
|
+
Updates an existing account resource with new values.
|
|
94
|
+
Only specified fields are modified; others remain unchanged.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
args: Dictionary of operation arguments.
|
|
98
|
+
Contains operation-specific parameters.
|
|
99
|
+
See method implementation for details.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
Dictionary containing updated account resource:
|
|
103
|
+
{
|
|
104
|
+
'guid': str, # Unique identifier
|
|
105
|
+
'attributes': dict, # Updated attributes
|
|
106
|
+
'updateTime': int # Update timestamp
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
Raises:
|
|
110
|
+
ValueError: When required parameters are missing or invalid:
|
|
111
|
+
- Empty or None values for required fields
|
|
112
|
+
- Invalid GUID format
|
|
113
|
+
- Out-of-range values
|
|
114
|
+
|
|
115
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
116
|
+
- DefaultAzureCredential not configured
|
|
117
|
+
- Insufficient permissions
|
|
118
|
+
- Expired authentication token
|
|
119
|
+
|
|
120
|
+
HTTPError: When Purview API returns error:
|
|
121
|
+
- 400: Bad request (invalid parameters)
|
|
122
|
+
- 401: Unauthorized (authentication failed)
|
|
123
|
+
- 403: Forbidden (insufficient permissions)
|
|
124
|
+
- 404: Resource not found
|
|
125
|
+
- 429: Rate limit exceeded
|
|
126
|
+
- 500: Internal server error
|
|
127
|
+
|
|
128
|
+
NetworkError: When network connectivity fails
|
|
129
|
+
|
|
130
|
+
Example:
|
|
131
|
+
# Basic usage
|
|
132
|
+
client = Account()
|
|
133
|
+
|
|
134
|
+
result = client.accountUpdate(args=...)
|
|
135
|
+
print(f"Result: {result}")
|
|
136
|
+
|
|
137
|
+
# With detailed data
|
|
138
|
+
data = {
|
|
139
|
+
'name': 'My Resource',
|
|
140
|
+
'description': 'Resource description',
|
|
141
|
+
'attributes': {
|
|
142
|
+
'key1': 'value1',
|
|
143
|
+
'key2': 'value2'
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
result = client.accountUpdate(data)
|
|
148
|
+
print(f"Created/Updated: {result['guid']}")
|
|
149
|
+
|
|
150
|
+
Use Cases:
|
|
151
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
152
|
+
- Ownership Changes: Reassign data ownership
|
|
153
|
+
- Classification: Apply or modify data classifications
|
|
154
|
+
"""
|
|
155
|
+
self.method = "PATCH"
|
|
156
|
+
self.endpoint = ENDPOINTS["account"]["update"]
|
|
157
|
+
self.params = get_api_version_params("account")
|
|
158
|
+
self.payload = get_json(args, "--payloadFile")
|
|
159
|
+
|
|
160
|
+
# === ACCESS KEY MANAGEMENT ===
|
|
161
|
+
|
|
162
|
+
@decorator
|
|
163
|
+
def accountReadAccessKeys(self, args):
|
|
164
|
+
"""
|
|
165
|
+
Retrieve account resource information.
|
|
166
|
+
|
|
167
|
+
Retrieves detailed information about the specified account resource.
|
|
168
|
+
Returns complete account resource metadata and properties.
|
|
169
|
+
|
|
170
|
+
Args:
|
|
171
|
+
args: Dictionary of operation arguments.
|
|
172
|
+
Contains operation-specific parameters.
|
|
173
|
+
See method implementation for details.
|
|
174
|
+
|
|
175
|
+
Returns:
|
|
176
|
+
Dictionary containing account resource information:
|
|
177
|
+
{
|
|
178
|
+
'guid': str, # Unique identifier
|
|
179
|
+
'name': str, # Resource name
|
|
180
|
+
'attributes': dict, # Resource attributes
|
|
181
|
+
'status': str, # Resource status
|
|
182
|
+
'updateTime': int # Last update timestamp
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
Raises:
|
|
186
|
+
ValueError: When required parameters are missing or invalid:
|
|
187
|
+
- Empty or None values for required fields
|
|
188
|
+
- Invalid GUID format
|
|
189
|
+
- Out-of-range values
|
|
190
|
+
|
|
191
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
192
|
+
- DefaultAzureCredential not configured
|
|
193
|
+
- Insufficient permissions
|
|
194
|
+
- Expired authentication token
|
|
195
|
+
|
|
196
|
+
HTTPError: When Purview API returns error:
|
|
197
|
+
- 400: Bad request (invalid parameters)
|
|
198
|
+
- 401: Unauthorized (authentication failed)
|
|
199
|
+
- 403: Forbidden (insufficient permissions)
|
|
200
|
+
- 404: Resource not found
|
|
201
|
+
- 429: Rate limit exceeded
|
|
202
|
+
- 500: Internal server error
|
|
203
|
+
|
|
204
|
+
NetworkError: When network connectivity fails
|
|
205
|
+
|
|
206
|
+
Example:
|
|
207
|
+
# Basic usage
|
|
208
|
+
client = Account()
|
|
209
|
+
|
|
210
|
+
result = client.accountReadAccessKeys(args=...)
|
|
211
|
+
print(f"Result: {result}")
|
|
212
|
+
|
|
213
|
+
Use Cases:
|
|
214
|
+
- Data Discovery: Find and explore data assets
|
|
215
|
+
- Compliance Auditing: Review metadata and classifications
|
|
216
|
+
- Reporting: Generate catalog reports
|
|
217
|
+
"""
|
|
218
|
+
self.method = "POST"
|
|
219
|
+
self.endpoint = ENDPOINTS["account"]["get_access_keys"]
|
|
220
|
+
self.params = get_api_version_params("account")
|
|
221
|
+
|
|
222
|
+
@decorator
|
|
223
|
+
def accountRegenerateAccessKey(self, args):
|
|
224
|
+
"""
|
|
225
|
+
Perform operation on resource.
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
Args:
|
|
230
|
+
args: Dictionary of operation arguments.
|
|
231
|
+
Contains operation-specific parameters.
|
|
232
|
+
See method implementation for details.
|
|
233
|
+
|
|
234
|
+
Returns:
|
|
235
|
+
[TODO: Specify return type and structure]
|
|
236
|
+
[TODO: Document nested fields]
|
|
237
|
+
|
|
238
|
+
Raises:
|
|
239
|
+
ValueError: When required parameters are missing or invalid:
|
|
240
|
+
- Empty or None values for required fields
|
|
241
|
+
- Invalid GUID format
|
|
242
|
+
- Out-of-range values
|
|
243
|
+
|
|
244
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
245
|
+
- DefaultAzureCredential not configured
|
|
246
|
+
- Insufficient permissions
|
|
247
|
+
- Expired authentication token
|
|
248
|
+
|
|
249
|
+
HTTPError: When Purview API returns error:
|
|
250
|
+
- 400: Bad request (invalid parameters)
|
|
251
|
+
- 401: Unauthorized (authentication failed)
|
|
252
|
+
- 403: Forbidden (insufficient permissions)
|
|
253
|
+
- 404: Resource not found
|
|
254
|
+
- 429: Rate limit exceeded
|
|
255
|
+
- 500: Internal server error
|
|
256
|
+
|
|
257
|
+
NetworkError: When network connectivity fails
|
|
258
|
+
|
|
259
|
+
Example:
|
|
260
|
+
# Basic usage
|
|
261
|
+
client = Account()
|
|
262
|
+
|
|
263
|
+
result = client.accountRegenerateAccessKey(args=...)
|
|
264
|
+
print(f"Result: {result}")
|
|
265
|
+
|
|
266
|
+
Use Cases:
|
|
267
|
+
- [TODO: Add specific use cases for this operation]
|
|
268
|
+
- [TODO: Include business context]
|
|
269
|
+
- [TODO: Explain when to use this method]
|
|
270
|
+
"""
|
|
271
|
+
self.method = "POST"
|
|
272
|
+
self.endpoint = ENDPOINTS["account"]["regenerate_access_key"]
|
|
273
|
+
self.params = get_api_version_params("account")
|
|
274
|
+
|
|
275
|
+
regenerate_request = {
|
|
276
|
+
"keyType": args["--keyType"] # "PrimaryKey" or "SecondaryKey"
|
|
277
|
+
}
|
|
278
|
+
self.payload = regenerate_request
|
|
279
|
+
|
|
280
|
+
# === ADVANCED ACCOUNT OPERATIONS (NEW FOR 100% COVERAGE) ===
|
|
281
|
+
|
|
282
|
+
@decorator
|
|
283
|
+
def accountReadInfo(self, args):
|
|
284
|
+
"""
|
|
285
|
+
Retrieve account resource information.
|
|
286
|
+
|
|
287
|
+
Retrieves detailed information about the specified account resource.
|
|
288
|
+
Returns complete account resource metadata and properties.
|
|
289
|
+
|
|
290
|
+
Args:
|
|
291
|
+
args: Dictionary of operation arguments.
|
|
292
|
+
Contains operation-specific parameters.
|
|
293
|
+
See method implementation for details.
|
|
294
|
+
|
|
295
|
+
Returns:
|
|
296
|
+
Dictionary containing account resource information:
|
|
297
|
+
{
|
|
298
|
+
'guid': str, # Unique identifier
|
|
299
|
+
'name': str, # Resource name
|
|
300
|
+
'attributes': dict, # Resource attributes
|
|
301
|
+
'status': str, # Resource status
|
|
302
|
+
'updateTime': int # Last update timestamp
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
Raises:
|
|
306
|
+
ValueError: When required parameters are missing or invalid:
|
|
307
|
+
- Empty or None values for required fields
|
|
308
|
+
- Invalid GUID format
|
|
309
|
+
- Out-of-range values
|
|
310
|
+
|
|
311
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
312
|
+
- DefaultAzureCredential not configured
|
|
313
|
+
- Insufficient permissions
|
|
314
|
+
- Expired authentication token
|
|
315
|
+
|
|
316
|
+
HTTPError: When Purview API returns error:
|
|
317
|
+
- 400: Bad request (invalid parameters)
|
|
318
|
+
- 401: Unauthorized (authentication failed)
|
|
319
|
+
- 403: Forbidden (insufficient permissions)
|
|
320
|
+
- 404: Resource not found
|
|
321
|
+
- 429: Rate limit exceeded
|
|
322
|
+
- 500: Internal server error
|
|
323
|
+
|
|
324
|
+
NetworkError: When network connectivity fails
|
|
325
|
+
|
|
326
|
+
Example:
|
|
327
|
+
# Basic usage
|
|
328
|
+
client = Account()
|
|
329
|
+
|
|
330
|
+
result = client.accountReadInfo(args=...)
|
|
331
|
+
print(f"Result: {result}")
|
|
332
|
+
|
|
333
|
+
Use Cases:
|
|
334
|
+
- Data Discovery: Find and explore data assets
|
|
335
|
+
- Compliance Auditing: Review metadata and classifications
|
|
336
|
+
- Reporting: Generate catalog reports
|
|
337
|
+
"""
|
|
338
|
+
self.method = "GET"
|
|
339
|
+
self.endpoint = ENDPOINTS["account"]["get_account_info"]
|
|
340
|
+
self.params = {
|
|
341
|
+
**get_api_version_params("account"),
|
|
342
|
+
"includeMetrics": str(args.get("--includeMetrics", True)).lower(),
|
|
343
|
+
"includeRegions": str(args.get("--includeRegions", True)).lower(),
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
@decorator
|
|
347
|
+
def accountReadSettings(self, args):
|
|
348
|
+
"""
|
|
349
|
+
Retrieve account resource information.
|
|
350
|
+
|
|
351
|
+
Retrieves detailed information about the specified account resource.
|
|
352
|
+
Returns complete account resource metadata and properties.
|
|
353
|
+
|
|
354
|
+
Args:
|
|
355
|
+
args: Dictionary of operation arguments.
|
|
356
|
+
Contains operation-specific parameters.
|
|
357
|
+
See method implementation for details.
|
|
358
|
+
|
|
359
|
+
Returns:
|
|
360
|
+
Dictionary containing account resource information:
|
|
361
|
+
{
|
|
362
|
+
'guid': str, # Unique identifier
|
|
363
|
+
'name': str, # Resource name
|
|
364
|
+
'attributes': dict, # Resource attributes
|
|
365
|
+
'status': str, # Resource status
|
|
366
|
+
'updateTime': int # Last update timestamp
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
Raises:
|
|
370
|
+
ValueError: When required parameters are missing or invalid:
|
|
371
|
+
- Empty or None values for required fields
|
|
372
|
+
- Invalid GUID format
|
|
373
|
+
- Out-of-range values
|
|
374
|
+
|
|
375
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
376
|
+
- DefaultAzureCredential not configured
|
|
377
|
+
- Insufficient permissions
|
|
378
|
+
- Expired authentication token
|
|
379
|
+
|
|
380
|
+
HTTPError: When Purview API returns error:
|
|
381
|
+
- 400: Bad request (invalid parameters)
|
|
382
|
+
- 401: Unauthorized (authentication failed)
|
|
383
|
+
- 403: Forbidden (insufficient permissions)
|
|
384
|
+
- 404: Resource not found
|
|
385
|
+
- 429: Rate limit exceeded
|
|
386
|
+
- 500: Internal server error
|
|
387
|
+
|
|
388
|
+
NetworkError: When network connectivity fails
|
|
389
|
+
|
|
390
|
+
Example:
|
|
391
|
+
# Basic usage
|
|
392
|
+
client = Account()
|
|
393
|
+
|
|
394
|
+
result = client.accountReadSettings(args=...)
|
|
395
|
+
print(f"Result: {result}")
|
|
396
|
+
|
|
397
|
+
Use Cases:
|
|
398
|
+
- Data Discovery: Find and explore data assets
|
|
399
|
+
- Compliance Auditing: Review metadata and classifications
|
|
400
|
+
- Reporting: Generate catalog reports
|
|
401
|
+
"""
|
|
402
|
+
self.method = "GET"
|
|
403
|
+
self.endpoint = ENDPOINTS["account"]["get_account_settings"]
|
|
404
|
+
self.params = get_api_version_params("account")
|
|
405
|
+
|
|
406
|
+
@decorator
|
|
407
|
+
def accountUpdateSettings(self, args):
|
|
408
|
+
"""
|
|
409
|
+
Update an existing account resource.
|
|
410
|
+
|
|
411
|
+
Updates an existing account resource with new values.
|
|
412
|
+
Only specified fields are modified; others remain unchanged.
|
|
413
|
+
|
|
414
|
+
Args:
|
|
415
|
+
args: Dictionary of operation arguments.
|
|
416
|
+
Contains operation-specific parameters.
|
|
417
|
+
See method implementation for details.
|
|
418
|
+
|
|
419
|
+
Returns:
|
|
420
|
+
Dictionary containing updated account resource:
|
|
421
|
+
{
|
|
422
|
+
'guid': str, # Unique identifier
|
|
423
|
+
'attributes': dict, # Updated attributes
|
|
424
|
+
'updateTime': int # Update timestamp
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
Raises:
|
|
428
|
+
ValueError: When required parameters are missing or invalid:
|
|
429
|
+
- Empty or None values for required fields
|
|
430
|
+
- Invalid GUID format
|
|
431
|
+
- Out-of-range values
|
|
432
|
+
|
|
433
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
434
|
+
- DefaultAzureCredential not configured
|
|
435
|
+
- Insufficient permissions
|
|
436
|
+
- Expired authentication token
|
|
437
|
+
|
|
438
|
+
HTTPError: When Purview API returns error:
|
|
439
|
+
- 400: Bad request (invalid parameters)
|
|
440
|
+
- 401: Unauthorized (authentication failed)
|
|
441
|
+
- 403: Forbidden (insufficient permissions)
|
|
442
|
+
- 404: Resource not found
|
|
443
|
+
- 429: Rate limit exceeded
|
|
444
|
+
- 500: Internal server error
|
|
445
|
+
|
|
446
|
+
NetworkError: When network connectivity fails
|
|
447
|
+
|
|
448
|
+
Example:
|
|
449
|
+
# Basic usage
|
|
450
|
+
client = Account()
|
|
451
|
+
|
|
452
|
+
result = client.accountUpdateSettings(args=...)
|
|
453
|
+
print(f"Result: {result}")
|
|
454
|
+
|
|
455
|
+
# With detailed data
|
|
456
|
+
data = {
|
|
457
|
+
'name': 'My Resource',
|
|
458
|
+
'description': 'Resource description',
|
|
459
|
+
'attributes': {
|
|
460
|
+
'key1': 'value1',
|
|
461
|
+
'key2': 'value2'
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
result = client.accountUpdateSettings(data)
|
|
466
|
+
print(f"Created/Updated: {result['guid']}")
|
|
467
|
+
|
|
468
|
+
Use Cases:
|
|
469
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
470
|
+
- Ownership Changes: Reassign data ownership
|
|
471
|
+
- Classification: Apply or modify data classifications
|
|
472
|
+
"""
|
|
473
|
+
self.method = "PUT"
|
|
474
|
+
self.endpoint = ENDPOINTS["account"]["update_account_settings"]
|
|
475
|
+
self.params = get_api_version_params("account")
|
|
476
|
+
self.payload = get_json(args, "--payloadFile")
|
|
477
|
+
|
|
478
|
+
@decorator
|
|
479
|
+
def accountReadUsage(self, args):
|
|
480
|
+
"""
|
|
481
|
+
Retrieve account resource information.
|
|
482
|
+
|
|
483
|
+
Retrieves detailed information about the specified account resource.
|
|
484
|
+
Returns complete account resource metadata and properties.
|
|
485
|
+
|
|
486
|
+
Args:
|
|
487
|
+
args: Dictionary of operation arguments.
|
|
488
|
+
Contains operation-specific parameters.
|
|
489
|
+
See method implementation for details.
|
|
490
|
+
|
|
491
|
+
Returns:
|
|
492
|
+
Dictionary containing account resource information:
|
|
493
|
+
{
|
|
494
|
+
'guid': str, # Unique identifier
|
|
495
|
+
'name': str, # Resource name
|
|
496
|
+
'attributes': dict, # Resource attributes
|
|
497
|
+
'status': str, # Resource status
|
|
498
|
+
'updateTime': int # Last update timestamp
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
Raises:
|
|
502
|
+
ValueError: When required parameters are missing or invalid:
|
|
503
|
+
- Empty or None values for required fields
|
|
504
|
+
- Invalid GUID format
|
|
505
|
+
- Out-of-range values
|
|
506
|
+
|
|
507
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
508
|
+
- DefaultAzureCredential not configured
|
|
509
|
+
- Insufficient permissions
|
|
510
|
+
- Expired authentication token
|
|
511
|
+
|
|
512
|
+
HTTPError: When Purview API returns error:
|
|
513
|
+
- 400: Bad request (invalid parameters)
|
|
514
|
+
- 401: Unauthorized (authentication failed)
|
|
515
|
+
- 403: Forbidden (insufficient permissions)
|
|
516
|
+
- 404: Resource not found
|
|
517
|
+
- 429: Rate limit exceeded
|
|
518
|
+
- 500: Internal server error
|
|
519
|
+
|
|
520
|
+
NetworkError: When network connectivity fails
|
|
521
|
+
|
|
522
|
+
Example:
|
|
523
|
+
# Basic usage
|
|
524
|
+
client = Account()
|
|
525
|
+
|
|
526
|
+
result = client.accountReadUsage(args=...)
|
|
527
|
+
print(f"Result: {result}")
|
|
528
|
+
|
|
529
|
+
Use Cases:
|
|
530
|
+
- Data Discovery: Find and explore data assets
|
|
531
|
+
- Compliance Auditing: Review metadata and classifications
|
|
532
|
+
- Reporting: Generate catalog reports
|
|
533
|
+
"""
|
|
534
|
+
self.method = "GET"
|
|
535
|
+
self.endpoint = ENDPOINTS["account"]["get_account_usage"]
|
|
536
|
+
self.params = {
|
|
537
|
+
**get_api_version_params("account"),
|
|
538
|
+
"startTime": args.get("--startTime"),
|
|
539
|
+
"endTime": args.get("--endTime"),
|
|
540
|
+
"granularity": args.get("--granularity", "daily"),
|
|
541
|
+
"metrics": args.get("--metrics", "all"),
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
@decorator
|
|
545
|
+
def accountReadLimits(self, args):
|
|
546
|
+
"""
|
|
547
|
+
Retrieve account resource information.
|
|
548
|
+
|
|
549
|
+
Retrieves detailed information about the specified account resource.
|
|
550
|
+
Returns complete account resource metadata and properties.
|
|
551
|
+
|
|
552
|
+
Args:
|
|
553
|
+
args: Dictionary of operation arguments.
|
|
554
|
+
Contains operation-specific parameters.
|
|
555
|
+
See method implementation for details.
|
|
556
|
+
|
|
557
|
+
Returns:
|
|
558
|
+
Dictionary containing account resource information:
|
|
559
|
+
{
|
|
560
|
+
'guid': str, # Unique identifier
|
|
561
|
+
'name': str, # Resource name
|
|
562
|
+
'attributes': dict, # Resource attributes
|
|
563
|
+
'status': str, # Resource status
|
|
564
|
+
'updateTime': int # Last update timestamp
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
Raises:
|
|
568
|
+
ValueError: When required parameters are missing or invalid:
|
|
569
|
+
- Empty or None values for required fields
|
|
570
|
+
- Invalid GUID format
|
|
571
|
+
- Out-of-range values
|
|
572
|
+
|
|
573
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
574
|
+
- DefaultAzureCredential not configured
|
|
575
|
+
- Insufficient permissions
|
|
576
|
+
- Expired authentication token
|
|
577
|
+
|
|
578
|
+
HTTPError: When Purview API returns error:
|
|
579
|
+
- 400: Bad request (invalid parameters)
|
|
580
|
+
- 401: Unauthorized (authentication failed)
|
|
581
|
+
- 403: Forbidden (insufficient permissions)
|
|
582
|
+
- 404: Resource not found
|
|
583
|
+
- 429: Rate limit exceeded
|
|
584
|
+
- 500: Internal server error
|
|
585
|
+
|
|
586
|
+
NetworkError: When network connectivity fails
|
|
587
|
+
|
|
588
|
+
Example:
|
|
589
|
+
# Basic usage
|
|
590
|
+
client = Account()
|
|
591
|
+
|
|
592
|
+
result = client.accountReadLimits(args=...)
|
|
593
|
+
print(f"Result: {result}")
|
|
594
|
+
|
|
595
|
+
Use Cases:
|
|
596
|
+
- Data Discovery: Find and explore data assets
|
|
597
|
+
- Compliance Auditing: Review metadata and classifications
|
|
598
|
+
- Reporting: Generate catalog reports
|
|
599
|
+
"""
|
|
600
|
+
self.method = "GET"
|
|
601
|
+
self.endpoint = ENDPOINTS["account"]["get_account_limits"]
|
|
602
|
+
self.params = {
|
|
603
|
+
**get_api_version_params("account"),
|
|
604
|
+
"includeUsage": str(args.get("--includeUsage", True)).lower(),
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
@decorator
|
|
608
|
+
def accountReadAnalytics(self, args):
|
|
609
|
+
"""
|
|
610
|
+
Retrieve account resource information.
|
|
611
|
+
|
|
612
|
+
Retrieves detailed information about the specified account resource.
|
|
613
|
+
Returns complete account resource metadata and properties.
|
|
614
|
+
|
|
615
|
+
Args:
|
|
616
|
+
args: Dictionary of operation arguments.
|
|
617
|
+
Contains operation-specific parameters.
|
|
618
|
+
See method implementation for details.
|
|
619
|
+
|
|
620
|
+
Returns:
|
|
621
|
+
Dictionary containing account resource information:
|
|
622
|
+
{
|
|
623
|
+
'guid': str, # Unique identifier
|
|
624
|
+
'name': str, # Resource name
|
|
625
|
+
'attributes': dict, # Resource attributes
|
|
626
|
+
'status': str, # Resource status
|
|
627
|
+
'updateTime': int # Last update timestamp
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
Raises:
|
|
631
|
+
ValueError: When required parameters are missing or invalid:
|
|
632
|
+
- Empty or None values for required fields
|
|
633
|
+
- Invalid GUID format
|
|
634
|
+
- Out-of-range values
|
|
635
|
+
|
|
636
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
637
|
+
- DefaultAzureCredential not configured
|
|
638
|
+
- Insufficient permissions
|
|
639
|
+
- Expired authentication token
|
|
640
|
+
|
|
641
|
+
HTTPError: When Purview API returns error:
|
|
642
|
+
- 400: Bad request (invalid parameters)
|
|
643
|
+
- 401: Unauthorized (authentication failed)
|
|
644
|
+
- 403: Forbidden (insufficient permissions)
|
|
645
|
+
- 404: Resource not found
|
|
646
|
+
- 429: Rate limit exceeded
|
|
647
|
+
- 500: Internal server error
|
|
648
|
+
|
|
649
|
+
NetworkError: When network connectivity fails
|
|
650
|
+
|
|
651
|
+
Example:
|
|
652
|
+
# Basic usage
|
|
653
|
+
client = Account()
|
|
654
|
+
|
|
655
|
+
result = client.accountReadAnalytics(args=...)
|
|
656
|
+
print(f"Result: {result}")
|
|
657
|
+
|
|
658
|
+
Use Cases:
|
|
659
|
+
- Data Discovery: Find and explore data assets
|
|
660
|
+
- Compliance Auditing: Review metadata and classifications
|
|
661
|
+
- Reporting: Generate catalog reports
|
|
662
|
+
"""
|
|
663
|
+
self.method = "GET"
|
|
664
|
+
self.endpoint = ENDPOINTS["account"]["get_account_analytics"]
|
|
665
|
+
self.params = {
|
|
666
|
+
**get_api_version_params("account"),
|
|
667
|
+
"startTime": args.get("--startTime"),
|
|
668
|
+
"endTime": args.get("--endTime"),
|
|
669
|
+
"metrics": args.get("--metrics", "all"),
|
|
670
|
+
"aggregation": args.get("--aggregation", "daily"),
|
|
671
|
+
"includeBreakdown": str(args.get("--includeBreakdown", True)).lower(),
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
# === ACCOUNT CONFIGURATION MANAGEMENT ===
|
|
675
|
+
|
|
676
|
+
@decorator
|
|
677
|
+
def accountReadConfiguration(self, args):
|
|
678
|
+
"""
|
|
679
|
+
Retrieve account resource information.
|
|
680
|
+
|
|
681
|
+
Retrieves detailed information about the specified account resource.
|
|
682
|
+
Returns complete account resource metadata and properties.
|
|
683
|
+
|
|
684
|
+
Args:
|
|
685
|
+
args: Dictionary of operation arguments.
|
|
686
|
+
Contains operation-specific parameters.
|
|
687
|
+
See method implementation for details.
|
|
688
|
+
|
|
689
|
+
Returns:
|
|
690
|
+
Dictionary containing account resource information:
|
|
691
|
+
{
|
|
692
|
+
'guid': str, # Unique identifier
|
|
693
|
+
'name': str, # Resource name
|
|
694
|
+
'attributes': dict, # Resource attributes
|
|
695
|
+
'status': str, # Resource status
|
|
696
|
+
'updateTime': int # Last update timestamp
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
Raises:
|
|
700
|
+
ValueError: When required parameters are missing or invalid:
|
|
701
|
+
- Empty or None values for required fields
|
|
702
|
+
- Invalid GUID format
|
|
703
|
+
- Out-of-range values
|
|
704
|
+
|
|
705
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
706
|
+
- DefaultAzureCredential not configured
|
|
707
|
+
- Insufficient permissions
|
|
708
|
+
- Expired authentication token
|
|
709
|
+
|
|
710
|
+
HTTPError: When Purview API returns error:
|
|
711
|
+
- 400: Bad request (invalid parameters)
|
|
712
|
+
- 401: Unauthorized (authentication failed)
|
|
713
|
+
- 403: Forbidden (insufficient permissions)
|
|
714
|
+
- 404: Resource not found
|
|
715
|
+
- 429: Rate limit exceeded
|
|
716
|
+
- 500: Internal server error
|
|
717
|
+
|
|
718
|
+
NetworkError: When network connectivity fails
|
|
719
|
+
|
|
720
|
+
Example:
|
|
721
|
+
# Basic usage
|
|
722
|
+
client = Account()
|
|
723
|
+
|
|
724
|
+
result = client.accountReadConfiguration(args=...)
|
|
725
|
+
print(f"Result: {result}")
|
|
726
|
+
|
|
727
|
+
Use Cases:
|
|
728
|
+
- Data Discovery: Find and explore data assets
|
|
729
|
+
- Compliance Auditing: Review metadata and classifications
|
|
730
|
+
- Reporting: Generate catalog reports
|
|
731
|
+
"""
|
|
732
|
+
self.method = "GET"
|
|
733
|
+
self.endpoint = f"{ENDPOINTS['account']['get']}/configuration"
|
|
734
|
+
self.params = {
|
|
735
|
+
**get_api_version_params("account"),
|
|
736
|
+
"includeSecuritySettings": str(args.get("--includeSecuritySettings", True)).lower(),
|
|
737
|
+
"includeNetworkSettings": str(args.get("--includeNetworkSettings", True)).lower(),
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
@decorator
|
|
741
|
+
def accountUpdateConfiguration(self, args):
|
|
742
|
+
"""
|
|
743
|
+
Update an existing account resource.
|
|
744
|
+
|
|
745
|
+
Updates an existing account resource with new values.
|
|
746
|
+
Only specified fields are modified; others remain unchanged.
|
|
747
|
+
|
|
748
|
+
Args:
|
|
749
|
+
args: Dictionary of operation arguments.
|
|
750
|
+
Contains operation-specific parameters.
|
|
751
|
+
See method implementation for details.
|
|
752
|
+
|
|
753
|
+
Returns:
|
|
754
|
+
Dictionary containing updated account resource:
|
|
755
|
+
{
|
|
756
|
+
'guid': str, # Unique identifier
|
|
757
|
+
'attributes': dict, # Updated attributes
|
|
758
|
+
'updateTime': int # Update timestamp
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
Raises:
|
|
762
|
+
ValueError: When required parameters are missing or invalid:
|
|
763
|
+
- Empty or None values for required fields
|
|
764
|
+
- Invalid GUID format
|
|
765
|
+
- Out-of-range values
|
|
766
|
+
|
|
767
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
768
|
+
- DefaultAzureCredential not configured
|
|
769
|
+
- Insufficient permissions
|
|
770
|
+
- Expired authentication token
|
|
771
|
+
|
|
772
|
+
HTTPError: When Purview API returns error:
|
|
773
|
+
- 400: Bad request (invalid parameters)
|
|
774
|
+
- 401: Unauthorized (authentication failed)
|
|
775
|
+
- 403: Forbidden (insufficient permissions)
|
|
776
|
+
- 404: Resource not found
|
|
777
|
+
- 429: Rate limit exceeded
|
|
778
|
+
- 500: Internal server error
|
|
779
|
+
|
|
780
|
+
NetworkError: When network connectivity fails
|
|
781
|
+
|
|
782
|
+
Example:
|
|
783
|
+
# Basic usage
|
|
784
|
+
client = Account()
|
|
785
|
+
|
|
786
|
+
result = client.accountUpdateConfiguration(args=...)
|
|
787
|
+
print(f"Result: {result}")
|
|
788
|
+
|
|
789
|
+
# With detailed data
|
|
790
|
+
data = {
|
|
791
|
+
'name': 'My Resource',
|
|
792
|
+
'description': 'Resource description',
|
|
793
|
+
'attributes': {
|
|
794
|
+
'key1': 'value1',
|
|
795
|
+
'key2': 'value2'
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
result = client.accountUpdateConfiguration(data)
|
|
800
|
+
print(f"Created/Updated: {result['guid']}")
|
|
801
|
+
|
|
802
|
+
Use Cases:
|
|
803
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
804
|
+
- Ownership Changes: Reassign data ownership
|
|
805
|
+
- Classification: Apply or modify data classifications
|
|
806
|
+
"""
|
|
807
|
+
self.method = "PUT"
|
|
808
|
+
self.endpoint = f"{ENDPOINTS['account']['update']}/configuration"
|
|
809
|
+
self.params = get_api_version_params("account")
|
|
810
|
+
self.payload = get_json(args, "--payloadFile")
|
|
811
|
+
|
|
812
|
+
@decorator
|
|
813
|
+
def accountValidateConfiguration(self, args):
|
|
814
|
+
"""
|
|
815
|
+
Perform operation on resource.
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
Args:
|
|
820
|
+
args: Dictionary of operation arguments.
|
|
821
|
+
Contains operation-specific parameters.
|
|
822
|
+
See method implementation for details.
|
|
823
|
+
|
|
824
|
+
Returns:
|
|
825
|
+
[TODO: Specify return type and structure]
|
|
826
|
+
[TODO: Document nested fields]
|
|
827
|
+
|
|
828
|
+
Raises:
|
|
829
|
+
ValueError: When required parameters are missing or invalid:
|
|
830
|
+
- Empty or None values for required fields
|
|
831
|
+
- Invalid GUID format
|
|
832
|
+
- Out-of-range values
|
|
833
|
+
|
|
834
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
835
|
+
- DefaultAzureCredential not configured
|
|
836
|
+
- Insufficient permissions
|
|
837
|
+
- Expired authentication token
|
|
838
|
+
|
|
839
|
+
HTTPError: When Purview API returns error:
|
|
840
|
+
- 400: Bad request (invalid parameters)
|
|
841
|
+
- 401: Unauthorized (authentication failed)
|
|
842
|
+
- 403: Forbidden (insufficient permissions)
|
|
843
|
+
- 404: Resource not found
|
|
844
|
+
- 429: Rate limit exceeded
|
|
845
|
+
- 500: Internal server error
|
|
846
|
+
|
|
847
|
+
NetworkError: When network connectivity fails
|
|
848
|
+
|
|
849
|
+
Example:
|
|
850
|
+
# Basic usage
|
|
851
|
+
client = Account()
|
|
852
|
+
|
|
853
|
+
result = client.accountValidateConfiguration(args=...)
|
|
854
|
+
print(f"Result: {result}")
|
|
855
|
+
|
|
856
|
+
Use Cases:
|
|
857
|
+
- [TODO: Add specific use cases for this operation]
|
|
858
|
+
- [TODO: Include business context]
|
|
859
|
+
- [TODO: Explain when to use this method]
|
|
860
|
+
"""
|
|
861
|
+
self.method = "POST"
|
|
862
|
+
self.endpoint = f"{ENDPOINTS['account']['get']}/configuration/validate"
|
|
863
|
+
self.params = get_api_version_params("account")
|
|
864
|
+
self.payload = get_json(args, "--payloadFile")
|
|
865
|
+
|
|
866
|
+
# === ACCOUNT SECURITY OPERATIONS ===
|
|
867
|
+
|
|
868
|
+
@decorator
|
|
869
|
+
def accountReadSecuritySettings(self, args):
|
|
870
|
+
"""
|
|
871
|
+
Retrieve account resource information.
|
|
872
|
+
|
|
873
|
+
Retrieves detailed information about the specified account resource.
|
|
874
|
+
Returns complete account resource metadata and properties.
|
|
875
|
+
|
|
876
|
+
Args:
|
|
877
|
+
args: Dictionary of operation arguments.
|
|
878
|
+
Contains operation-specific parameters.
|
|
879
|
+
See method implementation for details.
|
|
880
|
+
|
|
881
|
+
Returns:
|
|
882
|
+
Dictionary containing account resource information:
|
|
883
|
+
{
|
|
884
|
+
'guid': str, # Unique identifier
|
|
885
|
+
'name': str, # Resource name
|
|
886
|
+
'attributes': dict, # Resource attributes
|
|
887
|
+
'status': str, # Resource status
|
|
888
|
+
'updateTime': int # Last update timestamp
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
Raises:
|
|
892
|
+
ValueError: When required parameters are missing or invalid:
|
|
893
|
+
- Empty or None values for required fields
|
|
894
|
+
- Invalid GUID format
|
|
895
|
+
- Out-of-range values
|
|
896
|
+
|
|
897
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
898
|
+
- DefaultAzureCredential not configured
|
|
899
|
+
- Insufficient permissions
|
|
900
|
+
- Expired authentication token
|
|
901
|
+
|
|
902
|
+
HTTPError: When Purview API returns error:
|
|
903
|
+
- 400: Bad request (invalid parameters)
|
|
904
|
+
- 401: Unauthorized (authentication failed)
|
|
905
|
+
- 403: Forbidden (insufficient permissions)
|
|
906
|
+
- 404: Resource not found
|
|
907
|
+
- 429: Rate limit exceeded
|
|
908
|
+
- 500: Internal server error
|
|
909
|
+
|
|
910
|
+
NetworkError: When network connectivity fails
|
|
911
|
+
|
|
912
|
+
Example:
|
|
913
|
+
# Basic usage
|
|
914
|
+
client = Account()
|
|
915
|
+
|
|
916
|
+
result = client.accountReadSecuritySettings(args=...)
|
|
917
|
+
print(f"Result: {result}")
|
|
918
|
+
|
|
919
|
+
Use Cases:
|
|
920
|
+
- Data Discovery: Find and explore data assets
|
|
921
|
+
- Compliance Auditing: Review metadata and classifications
|
|
922
|
+
- Reporting: Generate catalog reports
|
|
923
|
+
"""
|
|
924
|
+
self.method = "GET"
|
|
925
|
+
self.endpoint = f"{ENDPOINTS['account']['get']}/security"
|
|
926
|
+
self.params = get_api_version_params("account")
|
|
927
|
+
|
|
928
|
+
@decorator
|
|
929
|
+
def accountUpdateSecuritySettings(self, args):
|
|
930
|
+
"""
|
|
931
|
+
Update an existing account resource.
|
|
932
|
+
|
|
933
|
+
Updates an existing account resource with new values.
|
|
934
|
+
Only specified fields are modified; others remain unchanged.
|
|
935
|
+
|
|
936
|
+
Args:
|
|
937
|
+
args: Dictionary of operation arguments.
|
|
938
|
+
Contains operation-specific parameters.
|
|
939
|
+
See method implementation for details.
|
|
940
|
+
|
|
941
|
+
Returns:
|
|
942
|
+
Dictionary containing updated account resource:
|
|
943
|
+
{
|
|
944
|
+
'guid': str, # Unique identifier
|
|
945
|
+
'attributes': dict, # Updated attributes
|
|
946
|
+
'updateTime': int # Update timestamp
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
Raises:
|
|
950
|
+
ValueError: When required parameters are missing or invalid:
|
|
951
|
+
- Empty or None values for required fields
|
|
952
|
+
- Invalid GUID format
|
|
953
|
+
- Out-of-range values
|
|
954
|
+
|
|
955
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
956
|
+
- DefaultAzureCredential not configured
|
|
957
|
+
- Insufficient permissions
|
|
958
|
+
- Expired authentication token
|
|
959
|
+
|
|
960
|
+
HTTPError: When Purview API returns error:
|
|
961
|
+
- 400: Bad request (invalid parameters)
|
|
962
|
+
- 401: Unauthorized (authentication failed)
|
|
963
|
+
- 403: Forbidden (insufficient permissions)
|
|
964
|
+
- 404: Resource not found
|
|
965
|
+
- 429: Rate limit exceeded
|
|
966
|
+
- 500: Internal server error
|
|
967
|
+
|
|
968
|
+
NetworkError: When network connectivity fails
|
|
969
|
+
|
|
970
|
+
Example:
|
|
971
|
+
# Basic usage
|
|
972
|
+
client = Account()
|
|
973
|
+
|
|
974
|
+
result = client.accountUpdateSecuritySettings(args=...)
|
|
975
|
+
print(f"Result: {result}")
|
|
976
|
+
|
|
977
|
+
# With detailed data
|
|
978
|
+
data = {
|
|
979
|
+
'name': 'My Resource',
|
|
980
|
+
'description': 'Resource description',
|
|
981
|
+
'attributes': {
|
|
982
|
+
'key1': 'value1',
|
|
983
|
+
'key2': 'value2'
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
result = client.accountUpdateSecuritySettings(data)
|
|
988
|
+
print(f"Created/Updated: {result['guid']}")
|
|
989
|
+
|
|
990
|
+
Use Cases:
|
|
991
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
992
|
+
- Ownership Changes: Reassign data ownership
|
|
993
|
+
- Classification: Apply or modify data classifications
|
|
994
|
+
"""
|
|
995
|
+
self.method = "PUT"
|
|
996
|
+
self.endpoint = f"{ENDPOINTS['account']['update']}/security"
|
|
997
|
+
self.params = get_api_version_params("account")
|
|
998
|
+
self.payload = get_json(args, "--payloadFile")
|
|
999
|
+
|
|
1000
|
+
@decorator
|
|
1001
|
+
def accountReadAuditLogs(self, args):
|
|
1002
|
+
"""
|
|
1003
|
+
Retrieve account resource information.
|
|
1004
|
+
|
|
1005
|
+
Retrieves detailed information about the specified account resource.
|
|
1006
|
+
Returns complete account 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 account 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 = Account()
|
|
1047
|
+
|
|
1048
|
+
result = client.accountReadAuditLogs(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 = f"{ENDPOINTS['account']['get']}/audit"
|
|
1058
|
+
self.params = {
|
|
1059
|
+
**get_api_version_params("account"),
|
|
1060
|
+
"startTime": args.get("--startTime"),
|
|
1061
|
+
"endTime": args.get("--endTime"),
|
|
1062
|
+
"operation": args.get("--operation"),
|
|
1063
|
+
"user": args.get("--user"),
|
|
1064
|
+
"limit": args.get("--limit", 100),
|
|
1065
|
+
"offset": args.get("--offset", 0),
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
# === ACCOUNT NETWORKING OPERATIONS ===
|
|
1069
|
+
|
|
1070
|
+
@decorator
|
|
1071
|
+
def accountReadNetworkSettings(self, args):
|
|
1072
|
+
"""
|
|
1073
|
+
Retrieve account resource information.
|
|
1074
|
+
|
|
1075
|
+
Retrieves detailed information about the specified account resource.
|
|
1076
|
+
Returns complete account resource metadata and properties.
|
|
1077
|
+
|
|
1078
|
+
Args:
|
|
1079
|
+
args: Dictionary of operation arguments.
|
|
1080
|
+
Contains operation-specific parameters.
|
|
1081
|
+
See method implementation for details.
|
|
1082
|
+
|
|
1083
|
+
Returns:
|
|
1084
|
+
Dictionary containing account resource information:
|
|
1085
|
+
{
|
|
1086
|
+
'guid': str, # Unique identifier
|
|
1087
|
+
'name': str, # Resource name
|
|
1088
|
+
'attributes': dict, # Resource attributes
|
|
1089
|
+
'status': str, # Resource status
|
|
1090
|
+
'updateTime': int # Last update timestamp
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
Raises:
|
|
1094
|
+
ValueError: When required parameters are missing or invalid:
|
|
1095
|
+
- Empty or None values for required fields
|
|
1096
|
+
- Invalid GUID format
|
|
1097
|
+
- Out-of-range values
|
|
1098
|
+
|
|
1099
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1100
|
+
- DefaultAzureCredential not configured
|
|
1101
|
+
- Insufficient permissions
|
|
1102
|
+
- Expired authentication token
|
|
1103
|
+
|
|
1104
|
+
HTTPError: When Purview API returns error:
|
|
1105
|
+
- 400: Bad request (invalid parameters)
|
|
1106
|
+
- 401: Unauthorized (authentication failed)
|
|
1107
|
+
- 403: Forbidden (insufficient permissions)
|
|
1108
|
+
- 404: Resource not found
|
|
1109
|
+
- 429: Rate limit exceeded
|
|
1110
|
+
- 500: Internal server error
|
|
1111
|
+
|
|
1112
|
+
NetworkError: When network connectivity fails
|
|
1113
|
+
|
|
1114
|
+
Example:
|
|
1115
|
+
# Basic usage
|
|
1116
|
+
client = Account()
|
|
1117
|
+
|
|
1118
|
+
result = client.accountReadNetworkSettings(args=...)
|
|
1119
|
+
print(f"Result: {result}")
|
|
1120
|
+
|
|
1121
|
+
Use Cases:
|
|
1122
|
+
- Data Discovery: Find and explore data assets
|
|
1123
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1124
|
+
- Reporting: Generate catalog reports
|
|
1125
|
+
"""
|
|
1126
|
+
self.method = "GET"
|
|
1127
|
+
self.endpoint = f"{ENDPOINTS['account']['get']}/network"
|
|
1128
|
+
self.params = get_api_version_params("account")
|
|
1129
|
+
|
|
1130
|
+
@decorator
|
|
1131
|
+
def accountUpdateNetworkSettings(self, args):
|
|
1132
|
+
"""
|
|
1133
|
+
Update an existing account resource.
|
|
1134
|
+
|
|
1135
|
+
Updates an existing account resource with new values.
|
|
1136
|
+
Only specified fields are modified; others remain unchanged.
|
|
1137
|
+
|
|
1138
|
+
Args:
|
|
1139
|
+
args: Dictionary of operation arguments.
|
|
1140
|
+
Contains operation-specific parameters.
|
|
1141
|
+
See method implementation for details.
|
|
1142
|
+
|
|
1143
|
+
Returns:
|
|
1144
|
+
Dictionary containing updated account resource:
|
|
1145
|
+
{
|
|
1146
|
+
'guid': str, # Unique identifier
|
|
1147
|
+
'attributes': dict, # Updated attributes
|
|
1148
|
+
'updateTime': int # Update timestamp
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
Raises:
|
|
1152
|
+
ValueError: When required parameters are missing or invalid:
|
|
1153
|
+
- Empty or None values for required fields
|
|
1154
|
+
- Invalid GUID format
|
|
1155
|
+
- Out-of-range values
|
|
1156
|
+
|
|
1157
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1158
|
+
- DefaultAzureCredential not configured
|
|
1159
|
+
- Insufficient permissions
|
|
1160
|
+
- Expired authentication token
|
|
1161
|
+
|
|
1162
|
+
HTTPError: When Purview API returns error:
|
|
1163
|
+
- 400: Bad request (invalid parameters)
|
|
1164
|
+
- 401: Unauthorized (authentication failed)
|
|
1165
|
+
- 403: Forbidden (insufficient permissions)
|
|
1166
|
+
- 404: Resource not found
|
|
1167
|
+
- 429: Rate limit exceeded
|
|
1168
|
+
- 500: Internal server error
|
|
1169
|
+
|
|
1170
|
+
NetworkError: When network connectivity fails
|
|
1171
|
+
|
|
1172
|
+
Example:
|
|
1173
|
+
# Basic usage
|
|
1174
|
+
client = Account()
|
|
1175
|
+
|
|
1176
|
+
result = client.accountUpdateNetworkSettings(args=...)
|
|
1177
|
+
print(f"Result: {result}")
|
|
1178
|
+
|
|
1179
|
+
# With detailed data
|
|
1180
|
+
data = {
|
|
1181
|
+
'name': 'My Resource',
|
|
1182
|
+
'description': 'Resource description',
|
|
1183
|
+
'attributes': {
|
|
1184
|
+
'key1': 'value1',
|
|
1185
|
+
'key2': 'value2'
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
result = client.accountUpdateNetworkSettings(data)
|
|
1190
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1191
|
+
|
|
1192
|
+
Use Cases:
|
|
1193
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
1194
|
+
- Ownership Changes: Reassign data ownership
|
|
1195
|
+
- Classification: Apply or modify data classifications
|
|
1196
|
+
"""
|
|
1197
|
+
self.method = "PUT"
|
|
1198
|
+
self.endpoint = f"{ENDPOINTS['account']['update']}/network"
|
|
1199
|
+
self.params = get_api_version_params("account")
|
|
1200
|
+
self.payload = get_json(args, "--payloadFile")
|
|
1201
|
+
|
|
1202
|
+
@decorator
|
|
1203
|
+
def accountReadPrivateEndpoints(self, args):
|
|
1204
|
+
"""
|
|
1205
|
+
Retrieve account resource information.
|
|
1206
|
+
|
|
1207
|
+
Retrieves detailed information about the specified account resource.
|
|
1208
|
+
Returns complete account resource metadata and properties.
|
|
1209
|
+
|
|
1210
|
+
Args:
|
|
1211
|
+
args: Dictionary of operation arguments.
|
|
1212
|
+
Contains operation-specific parameters.
|
|
1213
|
+
See method implementation for details.
|
|
1214
|
+
|
|
1215
|
+
Returns:
|
|
1216
|
+
Dictionary containing account resource information:
|
|
1217
|
+
{
|
|
1218
|
+
'guid': str, # Unique identifier
|
|
1219
|
+
'name': str, # Resource name
|
|
1220
|
+
'attributes': dict, # Resource attributes
|
|
1221
|
+
'status': str, # Resource status
|
|
1222
|
+
'updateTime': int # Last update timestamp
|
|
1223
|
+
}
|
|
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 = Account()
|
|
1249
|
+
|
|
1250
|
+
result = client.accountReadPrivateEndpoints(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 = f"{ENDPOINTS['account']['get']}/privateEndpoints"
|
|
1260
|
+
self.params = {
|
|
1261
|
+
**get_api_version_params("account"),
|
|
1262
|
+
"includeStatus": str(args.get("--includeStatus", True)).lower(),
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
# === ACCOUNT BACKUP AND RESTORE OPERATIONS ===
|
|
1266
|
+
|
|
1267
|
+
@decorator
|
|
1268
|
+
def accountBackup(self, args):
|
|
1269
|
+
"""
|
|
1270
|
+
Perform operation on resource.
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
|
|
1274
|
+
Args:
|
|
1275
|
+
args: Dictionary of operation arguments.
|
|
1276
|
+
Contains operation-specific parameters.
|
|
1277
|
+
See method implementation for details.
|
|
1278
|
+
|
|
1279
|
+
Returns:
|
|
1280
|
+
[TODO: Specify return type and structure]
|
|
1281
|
+
[TODO: Document nested fields]
|
|
1282
|
+
|
|
1283
|
+
Raises:
|
|
1284
|
+
ValueError: When required parameters are missing or invalid:
|
|
1285
|
+
- Empty or None values for required fields
|
|
1286
|
+
- Invalid GUID format
|
|
1287
|
+
- Out-of-range values
|
|
1288
|
+
|
|
1289
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1290
|
+
- DefaultAzureCredential not configured
|
|
1291
|
+
- Insufficient permissions
|
|
1292
|
+
- Expired authentication token
|
|
1293
|
+
|
|
1294
|
+
HTTPError: When Purview API returns error:
|
|
1295
|
+
- 400: Bad request (invalid parameters)
|
|
1296
|
+
- 401: Unauthorized (authentication failed)
|
|
1297
|
+
- 403: Forbidden (insufficient permissions)
|
|
1298
|
+
- 404: Resource not found
|
|
1299
|
+
- 429: Rate limit exceeded
|
|
1300
|
+
- 500: Internal server error
|
|
1301
|
+
|
|
1302
|
+
NetworkError: When network connectivity fails
|
|
1303
|
+
|
|
1304
|
+
Example:
|
|
1305
|
+
# Basic usage
|
|
1306
|
+
client = Account()
|
|
1307
|
+
|
|
1308
|
+
result = client.accountBackup(args=...)
|
|
1309
|
+
print(f"Result: {result}")
|
|
1310
|
+
|
|
1311
|
+
Use Cases:
|
|
1312
|
+
- [TODO: Add specific use cases for this operation]
|
|
1313
|
+
- [TODO: Include business context]
|
|
1314
|
+
- [TODO: Explain when to use this method]
|
|
1315
|
+
"""
|
|
1316
|
+
self.method = "POST"
|
|
1317
|
+
self.endpoint = f"{ENDPOINTS['account']['get']}/backup"
|
|
1318
|
+
self.params = {
|
|
1319
|
+
**get_api_version_params("account"),
|
|
1320
|
+
"backupType": args.get("--backupType", "full"),
|
|
1321
|
+
"includeCollections": str(args.get("--includeCollections", True)).lower(),
|
|
1322
|
+
"includeSettings": str(args.get("--includeSettings", True)).lower(),
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
@decorator
|
|
1326
|
+
def accountRestore(self, args):
|
|
1327
|
+
"""
|
|
1328
|
+
Perform operation on resource.
|
|
1329
|
+
|
|
1330
|
+
|
|
1331
|
+
|
|
1332
|
+
Args:
|
|
1333
|
+
args: Dictionary of operation arguments.
|
|
1334
|
+
Contains operation-specific parameters.
|
|
1335
|
+
See method implementation for details.
|
|
1336
|
+
|
|
1337
|
+
Returns:
|
|
1338
|
+
[TODO: Specify return type and structure]
|
|
1339
|
+
[TODO: Document nested fields]
|
|
1340
|
+
|
|
1341
|
+
Raises:
|
|
1342
|
+
ValueError: When required parameters are missing or invalid:
|
|
1343
|
+
- Empty or None values for required fields
|
|
1344
|
+
- Invalid GUID format
|
|
1345
|
+
- Out-of-range values
|
|
1346
|
+
|
|
1347
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1348
|
+
- DefaultAzureCredential not configured
|
|
1349
|
+
- Insufficient permissions
|
|
1350
|
+
- Expired authentication token
|
|
1351
|
+
|
|
1352
|
+
HTTPError: When Purview API returns error:
|
|
1353
|
+
- 400: Bad request (invalid parameters)
|
|
1354
|
+
- 401: Unauthorized (authentication failed)
|
|
1355
|
+
- 403: Forbidden (insufficient permissions)
|
|
1356
|
+
- 404: Resource not found
|
|
1357
|
+
- 429: Rate limit exceeded
|
|
1358
|
+
- 500: Internal server error
|
|
1359
|
+
|
|
1360
|
+
NetworkError: When network connectivity fails
|
|
1361
|
+
|
|
1362
|
+
Example:
|
|
1363
|
+
# Basic usage
|
|
1364
|
+
client = Account()
|
|
1365
|
+
|
|
1366
|
+
result = client.accountRestore(args=...)
|
|
1367
|
+
print(f"Result: {result}")
|
|
1368
|
+
|
|
1369
|
+
Use Cases:
|
|
1370
|
+
- [TODO: Add specific use cases for this operation]
|
|
1371
|
+
- [TODO: Include business context]
|
|
1372
|
+
- [TODO: Explain when to use this method]
|
|
1373
|
+
"""
|
|
1374
|
+
self.method = "POST"
|
|
1375
|
+
self.endpoint = f"{ENDPOINTS['account']['update']}/restore"
|
|
1376
|
+
self.params = {
|
|
1377
|
+
**get_api_version_params("account"),
|
|
1378
|
+
"backupId": args["--backupId"],
|
|
1379
|
+
"restoreType": args.get("--restoreType", "full"),
|
|
1380
|
+
"validateOnly": str(args.get("--validateOnly", False)).lower(),
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
@decorator
|
|
1384
|
+
def accountReadBackups(self, args):
|
|
1385
|
+
"""
|
|
1386
|
+
Retrieve account resource information.
|
|
1387
|
+
|
|
1388
|
+
Retrieves detailed information about the specified account resource.
|
|
1389
|
+
Returns complete account resource metadata and properties.
|
|
1390
|
+
|
|
1391
|
+
Args:
|
|
1392
|
+
args: Dictionary of operation arguments.
|
|
1393
|
+
Contains operation-specific parameters.
|
|
1394
|
+
See method implementation for details.
|
|
1395
|
+
|
|
1396
|
+
Returns:
|
|
1397
|
+
Dictionary containing account resource information:
|
|
1398
|
+
{
|
|
1399
|
+
'guid': str, # Unique identifier
|
|
1400
|
+
'name': str, # Resource name
|
|
1401
|
+
'attributes': dict, # Resource attributes
|
|
1402
|
+
'status': str, # Resource status
|
|
1403
|
+
'updateTime': int # Last update timestamp
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
Raises:
|
|
1407
|
+
ValueError: When required parameters are missing or invalid:
|
|
1408
|
+
- Empty or None values for required fields
|
|
1409
|
+
- Invalid GUID format
|
|
1410
|
+
- Out-of-range values
|
|
1411
|
+
|
|
1412
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1413
|
+
- DefaultAzureCredential not configured
|
|
1414
|
+
- Insufficient permissions
|
|
1415
|
+
- Expired authentication token
|
|
1416
|
+
|
|
1417
|
+
HTTPError: When Purview API returns error:
|
|
1418
|
+
- 400: Bad request (invalid parameters)
|
|
1419
|
+
- 401: Unauthorized (authentication failed)
|
|
1420
|
+
- 403: Forbidden (insufficient permissions)
|
|
1421
|
+
- 404: Resource not found
|
|
1422
|
+
- 429: Rate limit exceeded
|
|
1423
|
+
- 500: Internal server error
|
|
1424
|
+
|
|
1425
|
+
NetworkError: When network connectivity fails
|
|
1426
|
+
|
|
1427
|
+
Example:
|
|
1428
|
+
# Basic usage
|
|
1429
|
+
client = Account()
|
|
1430
|
+
|
|
1431
|
+
result = client.accountReadBackups(args=...)
|
|
1432
|
+
print(f"Result: {result}")
|
|
1433
|
+
|
|
1434
|
+
Use Cases:
|
|
1435
|
+
- Data Discovery: Find and explore data assets
|
|
1436
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1437
|
+
- Reporting: Generate catalog reports
|
|
1438
|
+
"""
|
|
1439
|
+
self.method = "GET"
|
|
1440
|
+
self.endpoint = f"{ENDPOINTS['account']['get']}/backups"
|
|
1441
|
+
self.params = {
|
|
1442
|
+
**get_api_version_params("account"),
|
|
1443
|
+
"startTime": args.get("--startTime"),
|
|
1444
|
+
"endTime": args.get("--endTime"),
|
|
1445
|
+
"backupType": args.get("--backupType"),
|
|
1446
|
+
"limit": args.get("--limit", 50),
|
|
1447
|
+
"offset": args.get("--offset", 0),
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
# === ACCOUNT HEALTH AND MONITORING ===
|
|
1451
|
+
|
|
1452
|
+
@decorator
|
|
1453
|
+
def accountReadHealth(self, args):
|
|
1454
|
+
"""
|
|
1455
|
+
Retrieve account resource information.
|
|
1456
|
+
|
|
1457
|
+
Retrieves detailed information about the specified account resource.
|
|
1458
|
+
Returns complete account resource metadata and properties.
|
|
1459
|
+
|
|
1460
|
+
Args:
|
|
1461
|
+
args: Dictionary of operation arguments.
|
|
1462
|
+
Contains operation-specific parameters.
|
|
1463
|
+
See method implementation for details.
|
|
1464
|
+
|
|
1465
|
+
Returns:
|
|
1466
|
+
Dictionary containing account resource information:
|
|
1467
|
+
{
|
|
1468
|
+
'guid': str, # Unique identifier
|
|
1469
|
+
'name': str, # Resource name
|
|
1470
|
+
'attributes': dict, # Resource attributes
|
|
1471
|
+
'status': str, # Resource status
|
|
1472
|
+
'updateTime': int # Last update timestamp
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
Raises:
|
|
1476
|
+
ValueError: When required parameters are missing or invalid:
|
|
1477
|
+
- Empty or None values for required fields
|
|
1478
|
+
- Invalid GUID format
|
|
1479
|
+
- Out-of-range values
|
|
1480
|
+
|
|
1481
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1482
|
+
- DefaultAzureCredential not configured
|
|
1483
|
+
- Insufficient permissions
|
|
1484
|
+
- Expired authentication token
|
|
1485
|
+
|
|
1486
|
+
HTTPError: When Purview API returns error:
|
|
1487
|
+
- 400: Bad request (invalid parameters)
|
|
1488
|
+
- 401: Unauthorized (authentication failed)
|
|
1489
|
+
- 403: Forbidden (insufficient permissions)
|
|
1490
|
+
- 404: Resource not found
|
|
1491
|
+
- 429: Rate limit exceeded
|
|
1492
|
+
- 500: Internal server error
|
|
1493
|
+
|
|
1494
|
+
NetworkError: When network connectivity fails
|
|
1495
|
+
|
|
1496
|
+
Example:
|
|
1497
|
+
# Basic usage
|
|
1498
|
+
client = Account()
|
|
1499
|
+
|
|
1500
|
+
result = client.accountReadHealth(args=...)
|
|
1501
|
+
print(f"Result: {result}")
|
|
1502
|
+
|
|
1503
|
+
Use Cases:
|
|
1504
|
+
- Data Discovery: Find and explore data assets
|
|
1505
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1506
|
+
- Reporting: Generate catalog reports
|
|
1507
|
+
"""
|
|
1508
|
+
self.method = "GET"
|
|
1509
|
+
self.endpoint = f"{ENDPOINTS['account']['get']}/health"
|
|
1510
|
+
self.params = {
|
|
1511
|
+
**get_api_version_params("account"),
|
|
1512
|
+
"includeDetails": str(args.get("--includeDetails", True)).lower(),
|
|
1513
|
+
"checkConnectivity": str(args.get("--checkConnectivity", True)).lower(),
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
@decorator
|
|
1517
|
+
def accountReadMetrics(self, args):
|
|
1518
|
+
"""
|
|
1519
|
+
Retrieve account resource information.
|
|
1520
|
+
|
|
1521
|
+
Retrieves detailed information about the specified account resource.
|
|
1522
|
+
Returns complete account resource metadata and properties.
|
|
1523
|
+
|
|
1524
|
+
Args:
|
|
1525
|
+
args: Dictionary of operation arguments.
|
|
1526
|
+
Contains operation-specific parameters.
|
|
1527
|
+
See method implementation for details.
|
|
1528
|
+
|
|
1529
|
+
Returns:
|
|
1530
|
+
Dictionary containing account resource information:
|
|
1531
|
+
{
|
|
1532
|
+
'guid': str, # Unique identifier
|
|
1533
|
+
'name': str, # Resource name
|
|
1534
|
+
'attributes': dict, # Resource attributes
|
|
1535
|
+
'status': str, # Resource status
|
|
1536
|
+
'updateTime': int # Last update timestamp
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
Raises:
|
|
1540
|
+
ValueError: When required parameters are missing or invalid:
|
|
1541
|
+
- Empty or None values for required fields
|
|
1542
|
+
- Invalid GUID format
|
|
1543
|
+
- Out-of-range values
|
|
1544
|
+
|
|
1545
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1546
|
+
- DefaultAzureCredential not configured
|
|
1547
|
+
- Insufficient permissions
|
|
1548
|
+
- Expired authentication token
|
|
1549
|
+
|
|
1550
|
+
HTTPError: When Purview API returns error:
|
|
1551
|
+
- 400: Bad request (invalid parameters)
|
|
1552
|
+
- 401: Unauthorized (authentication failed)
|
|
1553
|
+
- 403: Forbidden (insufficient permissions)
|
|
1554
|
+
- 404: Resource not found
|
|
1555
|
+
- 429: Rate limit exceeded
|
|
1556
|
+
- 500: Internal server error
|
|
1557
|
+
|
|
1558
|
+
NetworkError: When network connectivity fails
|
|
1559
|
+
|
|
1560
|
+
Example:
|
|
1561
|
+
# Basic usage
|
|
1562
|
+
client = Account()
|
|
1563
|
+
|
|
1564
|
+
result = client.accountReadMetrics(args=...)
|
|
1565
|
+
print(f"Result: {result}")
|
|
1566
|
+
|
|
1567
|
+
Use Cases:
|
|
1568
|
+
- Data Discovery: Find and explore data assets
|
|
1569
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1570
|
+
- Reporting: Generate catalog reports
|
|
1571
|
+
"""
|
|
1572
|
+
self.method = "GET"
|
|
1573
|
+
self.endpoint = f"{ENDPOINTS['account']['get']}/metrics"
|
|
1574
|
+
self.params = {
|
|
1575
|
+
**get_api_version_params("account"),
|
|
1576
|
+
"startTime": args.get("--startTime"),
|
|
1577
|
+
"endTime": args.get("--endTime"),
|
|
1578
|
+
"metricNames": args.get("--metricNames"),
|
|
1579
|
+
"aggregation": args.get("--aggregation", "average"),
|
|
1580
|
+
"interval": args.get("--interval", "PT1H"),
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
@decorator
|
|
1584
|
+
def accountGenerateReport(self, args):
|
|
1585
|
+
"""
|
|
1586
|
+
Perform operation on resource.
|
|
1587
|
+
|
|
1588
|
+
|
|
1589
|
+
|
|
1590
|
+
Args:
|
|
1591
|
+
args: Dictionary of operation arguments.
|
|
1592
|
+
Contains operation-specific parameters.
|
|
1593
|
+
See method implementation for details.
|
|
1594
|
+
|
|
1595
|
+
Returns:
|
|
1596
|
+
[TODO: Specify return type and structure]
|
|
1597
|
+
[TODO: Document nested fields]
|
|
1598
|
+
|
|
1599
|
+
Raises:
|
|
1600
|
+
ValueError: When required parameters are missing or invalid:
|
|
1601
|
+
- Empty or None values for required fields
|
|
1602
|
+
- Invalid GUID format
|
|
1603
|
+
- Out-of-range values
|
|
1604
|
+
|
|
1605
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1606
|
+
- DefaultAzureCredential not configured
|
|
1607
|
+
- Insufficient permissions
|
|
1608
|
+
- Expired authentication token
|
|
1609
|
+
|
|
1610
|
+
HTTPError: When Purview API returns error:
|
|
1611
|
+
- 400: Bad request (invalid parameters)
|
|
1612
|
+
- 401: Unauthorized (authentication failed)
|
|
1613
|
+
- 403: Forbidden (insufficient permissions)
|
|
1614
|
+
- 404: Resource not found
|
|
1615
|
+
- 429: Rate limit exceeded
|
|
1616
|
+
- 500: Internal server error
|
|
1617
|
+
|
|
1618
|
+
NetworkError: When network connectivity fails
|
|
1619
|
+
|
|
1620
|
+
Example:
|
|
1621
|
+
# Basic usage
|
|
1622
|
+
client = Account()
|
|
1623
|
+
|
|
1624
|
+
result = client.accountGenerateReport(args=...)
|
|
1625
|
+
print(f"Result: {result}")
|
|
1626
|
+
|
|
1627
|
+
Use Cases:
|
|
1628
|
+
- [TODO: Add specific use cases for this operation]
|
|
1629
|
+
- [TODO: Include business context]
|
|
1630
|
+
- [TODO: Explain when to use this method]
|
|
1631
|
+
"""
|
|
1632
|
+
self.method = "POST"
|
|
1633
|
+
self.endpoint = f"{ENDPOINTS['account']['get']}/report"
|
|
1634
|
+
self.params = {
|
|
1635
|
+
**get_api_version_params("account"),
|
|
1636
|
+
"reportType": args.get("--reportType", "summary"),
|
|
1637
|
+
"format": args.get("--format", "json"),
|
|
1638
|
+
"includeUsage": str(args.get("--includeUsage", True)).lower(),
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
# === LEGACY COMPATIBILITY METHODS ===
|
|
1642
|
+
|
|
1643
|
+
@decorator
|
|
1644
|
+
def accountGet(self, args):
|
|
1645
|
+
"""
|
|
1646
|
+
Retrieve account resource information.
|
|
1647
|
+
|
|
1648
|
+
Retrieves detailed information about the specified account resource.
|
|
1649
|
+
Returns complete account resource metadata and properties.
|
|
1650
|
+
|
|
1651
|
+
Args:
|
|
1652
|
+
args: Dictionary of operation arguments.
|
|
1653
|
+
Contains operation-specific parameters.
|
|
1654
|
+
See method implementation for details.
|
|
1655
|
+
|
|
1656
|
+
Returns:
|
|
1657
|
+
Dictionary containing account resource information:
|
|
1658
|
+
{
|
|
1659
|
+
'guid': str, # Unique identifier
|
|
1660
|
+
'name': str, # Resource name
|
|
1661
|
+
'attributes': dict, # Resource attributes
|
|
1662
|
+
'status': str, # Resource status
|
|
1663
|
+
'updateTime': int # Last update timestamp
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
Raises:
|
|
1667
|
+
ValueError: When required parameters are missing or invalid:
|
|
1668
|
+
- Empty or None values for required fields
|
|
1669
|
+
- Invalid GUID format
|
|
1670
|
+
- Out-of-range values
|
|
1671
|
+
|
|
1672
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1673
|
+
- DefaultAzureCredential not configured
|
|
1674
|
+
- Insufficient permissions
|
|
1675
|
+
- Expired authentication token
|
|
1676
|
+
|
|
1677
|
+
HTTPError: When Purview API returns error:
|
|
1678
|
+
- 400: Bad request (invalid parameters)
|
|
1679
|
+
- 401: Unauthorized (authentication failed)
|
|
1680
|
+
- 403: Forbidden (insufficient permissions)
|
|
1681
|
+
- 404: Resource not found
|
|
1682
|
+
- 429: Rate limit exceeded
|
|
1683
|
+
- 500: Internal server error
|
|
1684
|
+
|
|
1685
|
+
NetworkError: When network connectivity fails
|
|
1686
|
+
|
|
1687
|
+
Example:
|
|
1688
|
+
# Basic usage
|
|
1689
|
+
client = Account()
|
|
1690
|
+
|
|
1691
|
+
result = client.accountGet(args=...)
|
|
1692
|
+
print(f"Result: {result}")
|
|
1693
|
+
|
|
1694
|
+
Use Cases:
|
|
1695
|
+
- Data Discovery: Find and explore data assets
|
|
1696
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1697
|
+
- Reporting: Generate catalog reports
|
|
1698
|
+
"""
|
|
1699
|
+
return self.accountRead(args)
|
|
1700
|
+
|
|
1701
|
+
@decorator
|
|
1702
|
+
def accountGetAccessKeys(self, args):
|
|
1703
|
+
"""
|
|
1704
|
+
Retrieve account resource information.
|
|
1705
|
+
|
|
1706
|
+
Retrieves detailed information about the specified account resource.
|
|
1707
|
+
Returns complete account resource metadata and properties.
|
|
1708
|
+
|
|
1709
|
+
Args:
|
|
1710
|
+
args: Dictionary of operation arguments.
|
|
1711
|
+
Contains operation-specific parameters.
|
|
1712
|
+
See method implementation for details.
|
|
1713
|
+
|
|
1714
|
+
Returns:
|
|
1715
|
+
Dictionary containing account resource information:
|
|
1716
|
+
{
|
|
1717
|
+
'guid': str, # Unique identifier
|
|
1718
|
+
'name': str, # Resource name
|
|
1719
|
+
'attributes': dict, # Resource attributes
|
|
1720
|
+
'status': str, # Resource status
|
|
1721
|
+
'updateTime': int # Last update timestamp
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
Raises:
|
|
1725
|
+
ValueError: When required parameters are missing or invalid:
|
|
1726
|
+
- Empty or None values for required fields
|
|
1727
|
+
- Invalid GUID format
|
|
1728
|
+
- Out-of-range values
|
|
1729
|
+
|
|
1730
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1731
|
+
- DefaultAzureCredential not configured
|
|
1732
|
+
- Insufficient permissions
|
|
1733
|
+
- Expired authentication token
|
|
1734
|
+
|
|
1735
|
+
HTTPError: When Purview API returns error:
|
|
1736
|
+
- 400: Bad request (invalid parameters)
|
|
1737
|
+
- 401: Unauthorized (authentication failed)
|
|
1738
|
+
- 403: Forbidden (insufficient permissions)
|
|
1739
|
+
- 404: Resource not found
|
|
1740
|
+
- 429: Rate limit exceeded
|
|
1741
|
+
- 500: Internal server error
|
|
1742
|
+
|
|
1743
|
+
NetworkError: When network connectivity fails
|
|
1744
|
+
|
|
1745
|
+
Example:
|
|
1746
|
+
# Basic usage
|
|
1747
|
+
client = Account()
|
|
1748
|
+
|
|
1749
|
+
result = client.accountGetAccessKeys(args=...)
|
|
1750
|
+
print(f"Result: {result}")
|
|
1751
|
+
|
|
1752
|
+
Use Cases:
|
|
1753
|
+
- Data Discovery: Find and explore data assets
|
|
1754
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1755
|
+
- Reporting: Generate catalog reports
|
|
1756
|
+
"""
|
|
1757
|
+
return self.accountReadAccessKeys(args)
|
|
1758
|
+
|
|
1759
|
+
@decorator
|
|
1760
|
+
def accountRegenerateKey(self, args):
|
|
1761
|
+
"""
|
|
1762
|
+
Perform operation on resource.
|
|
1763
|
+
|
|
1764
|
+
|
|
1765
|
+
|
|
1766
|
+
Args:
|
|
1767
|
+
args: Dictionary of operation arguments.
|
|
1768
|
+
Contains operation-specific parameters.
|
|
1769
|
+
See method implementation for details.
|
|
1770
|
+
|
|
1771
|
+
Returns:
|
|
1772
|
+
[TODO: Specify return type and structure]
|
|
1773
|
+
[TODO: Document nested fields]
|
|
1774
|
+
|
|
1775
|
+
Raises:
|
|
1776
|
+
ValueError: When required parameters are missing or invalid:
|
|
1777
|
+
- Empty or None values for required fields
|
|
1778
|
+
- Invalid GUID format
|
|
1779
|
+
- Out-of-range values
|
|
1780
|
+
|
|
1781
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1782
|
+
- DefaultAzureCredential not configured
|
|
1783
|
+
- Insufficient permissions
|
|
1784
|
+
- Expired authentication token
|
|
1785
|
+
|
|
1786
|
+
HTTPError: When Purview API returns error:
|
|
1787
|
+
- 400: Bad request (invalid parameters)
|
|
1788
|
+
- 401: Unauthorized (authentication failed)
|
|
1789
|
+
- 403: Forbidden (insufficient permissions)
|
|
1790
|
+
- 404: Resource not found
|
|
1791
|
+
- 429: Rate limit exceeded
|
|
1792
|
+
- 500: Internal server error
|
|
1793
|
+
|
|
1794
|
+
NetworkError: When network connectivity fails
|
|
1795
|
+
|
|
1796
|
+
Example:
|
|
1797
|
+
# Basic usage
|
|
1798
|
+
client = Account()
|
|
1799
|
+
|
|
1800
|
+
result = client.accountRegenerateKey(args=...)
|
|
1801
|
+
print(f"Result: {result}")
|
|
1802
|
+
|
|
1803
|
+
Use Cases:
|
|
1804
|
+
- [TODO: Add specific use cases for this operation]
|
|
1805
|
+
- [TODO: Include business context]
|
|
1806
|
+
- [TODO: Explain when to use this method]
|
|
1807
|
+
"""
|
|
1808
|
+
return self.accountRegenerateAccessKey(args)
|
|
1809
|
+
|
|
1810
|
+
@decorator
|
|
1811
|
+
def accountPut(self, args):
|
|
1812
|
+
"""
|
|
1813
|
+
Update an existing account resource.
|
|
1814
|
+
|
|
1815
|
+
Updates an existing account resource with new values.
|
|
1816
|
+
Only specified fields are modified; others remain unchanged.
|
|
1817
|
+
|
|
1818
|
+
Args:
|
|
1819
|
+
args: Dictionary of operation arguments.
|
|
1820
|
+
Contains operation-specific parameters.
|
|
1821
|
+
See method implementation for details.
|
|
1822
|
+
|
|
1823
|
+
Returns:
|
|
1824
|
+
Dictionary containing updated account resource:
|
|
1825
|
+
{
|
|
1826
|
+
'guid': str, # Unique identifier
|
|
1827
|
+
'attributes': dict, # Updated attributes
|
|
1828
|
+
'updateTime': int # Update timestamp
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
Raises:
|
|
1832
|
+
ValueError: When required parameters are missing or invalid:
|
|
1833
|
+
- Empty or None values for required fields
|
|
1834
|
+
- Invalid GUID format
|
|
1835
|
+
- Out-of-range values
|
|
1836
|
+
|
|
1837
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1838
|
+
- DefaultAzureCredential not configured
|
|
1839
|
+
- Insufficient permissions
|
|
1840
|
+
- Expired authentication token
|
|
1841
|
+
|
|
1842
|
+
HTTPError: When Purview API returns error:
|
|
1843
|
+
- 400: Bad request (invalid parameters)
|
|
1844
|
+
- 401: Unauthorized (authentication failed)
|
|
1845
|
+
- 403: Forbidden (insufficient permissions)
|
|
1846
|
+
- 404: Resource not found
|
|
1847
|
+
- 429: Rate limit exceeded
|
|
1848
|
+
- 500: Internal server error
|
|
1849
|
+
|
|
1850
|
+
NetworkError: When network connectivity fails
|
|
1851
|
+
|
|
1852
|
+
Example:
|
|
1853
|
+
# Basic usage
|
|
1854
|
+
client = Account()
|
|
1855
|
+
|
|
1856
|
+
result = client.accountPut(args=...)
|
|
1857
|
+
print(f"Result: {result}")
|
|
1858
|
+
|
|
1859
|
+
# With detailed data
|
|
1860
|
+
data = {
|
|
1861
|
+
'name': 'My Resource',
|
|
1862
|
+
'description': 'Resource description',
|
|
1863
|
+
'attributes': {
|
|
1864
|
+
'key1': 'value1',
|
|
1865
|
+
'key2': 'value2'
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
result = client.accountPut(data)
|
|
1870
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1871
|
+
|
|
1872
|
+
Use Cases:
|
|
1873
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
1874
|
+
- Ownership Changes: Reassign data ownership
|
|
1875
|
+
- Classification: Apply or modify data classifications
|
|
1876
|
+
"""
|
|
1877
|
+
return self.accountUpdate(args)
|