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,2734 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Microsoft Purview Workflow Client - Complete API Coverage
|
|
3
|
+
Handles Workflow Management, Approval Processes, and Business Process Automation
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from .endpoint import Endpoint, decorator, get_json
|
|
7
|
+
from .endpoints import ENDPOINTS, format_endpoint, get_api_version_params
|
|
8
|
+
|
|
9
|
+
class Workflow(Endpoint):
|
|
10
|
+
def __init__(self):
|
|
11
|
+
Endpoint.__init__(self)
|
|
12
|
+
self.app = 'datagovernance' # Use datagovernance for workflow endpoints
|
|
13
|
+
|
|
14
|
+
# ========== Workflow Management ==========
|
|
15
|
+
|
|
16
|
+
@decorator
|
|
17
|
+
def workflowListWorkflows(self, args):
|
|
18
|
+
"""
|
|
19
|
+
Retrieve workflow information.
|
|
20
|
+
|
|
21
|
+
Retrieves detailed information about the specified workflow.
|
|
22
|
+
Returns complete workflow metadata and properties.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
args: Dictionary of operation arguments.
|
|
26
|
+
Contains operation-specific parameters.
|
|
27
|
+
See method implementation for details.
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
List of resource dictionaries, each containing:
|
|
31
|
+
- guid (str): Unique identifier
|
|
32
|
+
- name (str): Resource name
|
|
33
|
+
- attributes (dict): Resource attributes
|
|
34
|
+
- status (str): Resource status
|
|
35
|
+
|
|
36
|
+
Returns empty list if no resources found.
|
|
37
|
+
|
|
38
|
+
Raises:
|
|
39
|
+
ValueError: When required parameters are missing or invalid:
|
|
40
|
+
- Empty or None values for required fields
|
|
41
|
+
- Invalid GUID format
|
|
42
|
+
- Out-of-range values
|
|
43
|
+
|
|
44
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
45
|
+
- DefaultAzureCredential not configured
|
|
46
|
+
- Insufficient permissions
|
|
47
|
+
- Expired authentication token
|
|
48
|
+
|
|
49
|
+
HTTPError: When Purview API returns error:
|
|
50
|
+
- 400: Bad request (invalid parameters)
|
|
51
|
+
- 401: Unauthorized (authentication failed)
|
|
52
|
+
- 403: Forbidden (insufficient permissions)
|
|
53
|
+
- 404: Resource not found
|
|
54
|
+
- 429: Rate limit exceeded
|
|
55
|
+
- 500: Internal server error
|
|
56
|
+
|
|
57
|
+
NetworkError: When network connectivity fails
|
|
58
|
+
|
|
59
|
+
Example:
|
|
60
|
+
# Basic usage
|
|
61
|
+
client = Workflow()
|
|
62
|
+
|
|
63
|
+
result = client.workflowListWorkflows(args=...)
|
|
64
|
+
print(f"Result: {result}")
|
|
65
|
+
|
|
66
|
+
Use Cases:
|
|
67
|
+
- Data Discovery: Find and explore data assets
|
|
68
|
+
- Compliance Auditing: Review metadata and classifications
|
|
69
|
+
- Reporting: Generate catalog reports
|
|
70
|
+
"""
|
|
71
|
+
self.method = 'GET'
|
|
72
|
+
self.endpoint = '/datagovernance/dataaccess/workflows'
|
|
73
|
+
self.params = {}
|
|
74
|
+
|
|
75
|
+
@decorator
|
|
76
|
+
def workflowCreateWorkflow(self, args):
|
|
77
|
+
"""
|
|
78
|
+
Create a new workflow.
|
|
79
|
+
|
|
80
|
+
Creates a new workflow in Microsoft Purview Workflows. Automate governance tasks.
|
|
81
|
+
Requires appropriate permissions and valid workflow definition.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
args: Dictionary of operation arguments.
|
|
85
|
+
Contains operation-specific parameters.
|
|
86
|
+
See method implementation for details.
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
Dictionary containing created workflow:
|
|
90
|
+
{
|
|
91
|
+
'guid': str, # Unique identifier
|
|
92
|
+
'name': str, # Resource name
|
|
93
|
+
'status': str, # Creation status
|
|
94
|
+
'attributes': dict, # Resource attributes
|
|
95
|
+
'createTime': int # Creation timestamp
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
Raises:
|
|
99
|
+
ValueError: When required parameters are missing or invalid:
|
|
100
|
+
- Empty or None values for required fields
|
|
101
|
+
- Invalid GUID format
|
|
102
|
+
- Out-of-range values
|
|
103
|
+
|
|
104
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
105
|
+
- DefaultAzureCredential not configured
|
|
106
|
+
- Insufficient permissions
|
|
107
|
+
- Expired authentication token
|
|
108
|
+
|
|
109
|
+
HTTPError: When Purview API returns error:
|
|
110
|
+
- 400: Bad request (invalid parameters)
|
|
111
|
+
- 401: Unauthorized (authentication failed)
|
|
112
|
+
- 403: Forbidden (insufficient permissions)
|
|
113
|
+
- 404: Resource not found
|
|
114
|
+
- 409: Conflict (resource already exists)
|
|
115
|
+
- 429: Rate limit exceeded
|
|
116
|
+
- 500: Internal server error
|
|
117
|
+
|
|
118
|
+
NetworkError: When network connectivity fails
|
|
119
|
+
|
|
120
|
+
Example:
|
|
121
|
+
# Basic usage
|
|
122
|
+
client = Workflow()
|
|
123
|
+
|
|
124
|
+
result = client.workflowCreateWorkflow(args=...)
|
|
125
|
+
print(f"Result: {result}")
|
|
126
|
+
|
|
127
|
+
# With detailed data
|
|
128
|
+
data = {
|
|
129
|
+
'name': 'My Resource',
|
|
130
|
+
'description': 'Resource description',
|
|
131
|
+
'attributes': {
|
|
132
|
+
'key1': 'value1',
|
|
133
|
+
'key2': 'value2'
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
result = client.workflowCreateWorkflow(data)
|
|
138
|
+
print(f"Created/Updated: {result['guid']}")
|
|
139
|
+
|
|
140
|
+
Use Cases:
|
|
141
|
+
- Data Onboarding: Register new data sources in catalog
|
|
142
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
143
|
+
- Automation: Programmatically populate catalog
|
|
144
|
+
"""
|
|
145
|
+
self.method = 'PUT'
|
|
146
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['create_workflow'],
|
|
147
|
+
workflowId=args['--workflowId'])
|
|
148
|
+
self.params = get_api_version_params('workflow')
|
|
149
|
+
self.payload = get_json(args, '--payloadFile')
|
|
150
|
+
|
|
151
|
+
@decorator
|
|
152
|
+
def workflowGetWorkflow(self, args):
|
|
153
|
+
"""
|
|
154
|
+
Retrieve workflow information.
|
|
155
|
+
|
|
156
|
+
Retrieves detailed information about the specified workflow.
|
|
157
|
+
Returns complete workflow metadata and properties.
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
args: Dictionary of operation arguments.
|
|
161
|
+
Contains operation-specific parameters.
|
|
162
|
+
See method implementation for details.
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
Dictionary containing workflow information:
|
|
166
|
+
{
|
|
167
|
+
'guid': str, # Unique identifier
|
|
168
|
+
'name': str, # Resource name
|
|
169
|
+
'attributes': dict, # Resource attributes
|
|
170
|
+
'status': str, # Resource status
|
|
171
|
+
'updateTime': int # Last update timestamp
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
Raises:
|
|
175
|
+
ValueError: When required parameters are missing or invalid:
|
|
176
|
+
- Empty or None values for required fields
|
|
177
|
+
- Invalid GUID format
|
|
178
|
+
- Out-of-range values
|
|
179
|
+
|
|
180
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
181
|
+
- DefaultAzureCredential not configured
|
|
182
|
+
- Insufficient permissions
|
|
183
|
+
- Expired authentication token
|
|
184
|
+
|
|
185
|
+
HTTPError: When Purview API returns error:
|
|
186
|
+
- 400: Bad request (invalid parameters)
|
|
187
|
+
- 401: Unauthorized (authentication failed)
|
|
188
|
+
- 403: Forbidden (insufficient permissions)
|
|
189
|
+
- 404: Resource not found
|
|
190
|
+
- 429: Rate limit exceeded
|
|
191
|
+
- 500: Internal server error
|
|
192
|
+
|
|
193
|
+
NetworkError: When network connectivity fails
|
|
194
|
+
|
|
195
|
+
Example:
|
|
196
|
+
# Basic usage
|
|
197
|
+
client = Workflow()
|
|
198
|
+
|
|
199
|
+
result = client.workflowGetWorkflow(args=...)
|
|
200
|
+
print(f"Result: {result}")
|
|
201
|
+
|
|
202
|
+
Use Cases:
|
|
203
|
+
- Data Discovery: Find and explore data assets
|
|
204
|
+
- Compliance Auditing: Review metadata and classifications
|
|
205
|
+
- Reporting: Generate catalog reports
|
|
206
|
+
"""
|
|
207
|
+
self.method = 'GET'
|
|
208
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['get_workflow'],
|
|
209
|
+
workflowId=args['--workflowId'])
|
|
210
|
+
self.params = get_api_version_params('workflow')
|
|
211
|
+
|
|
212
|
+
@decorator
|
|
213
|
+
def workflowUpdateWorkflow(self, args):
|
|
214
|
+
"""
|
|
215
|
+
Update an existing workflow.
|
|
216
|
+
|
|
217
|
+
Updates an existing workflow with new values.
|
|
218
|
+
Only specified fields are modified; others remain unchanged.
|
|
219
|
+
|
|
220
|
+
Args:
|
|
221
|
+
args: Dictionary of operation arguments.
|
|
222
|
+
Contains operation-specific parameters.
|
|
223
|
+
See method implementation for details.
|
|
224
|
+
|
|
225
|
+
Returns:
|
|
226
|
+
Dictionary containing updated workflow:
|
|
227
|
+
{
|
|
228
|
+
'guid': str, # Unique identifier
|
|
229
|
+
'attributes': dict, # Updated attributes
|
|
230
|
+
'updateTime': int # Update timestamp
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
Raises:
|
|
234
|
+
ValueError: When required parameters are missing or invalid:
|
|
235
|
+
- Empty or None values for required fields
|
|
236
|
+
- Invalid GUID format
|
|
237
|
+
- Out-of-range values
|
|
238
|
+
|
|
239
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
240
|
+
- DefaultAzureCredential not configured
|
|
241
|
+
- Insufficient permissions
|
|
242
|
+
- Expired authentication token
|
|
243
|
+
|
|
244
|
+
HTTPError: When Purview API returns error:
|
|
245
|
+
- 400: Bad request (invalid parameters)
|
|
246
|
+
- 401: Unauthorized (authentication failed)
|
|
247
|
+
- 403: Forbidden (insufficient permissions)
|
|
248
|
+
- 404: Resource not found
|
|
249
|
+
- 429: Rate limit exceeded
|
|
250
|
+
- 500: Internal server error
|
|
251
|
+
|
|
252
|
+
NetworkError: When network connectivity fails
|
|
253
|
+
|
|
254
|
+
Example:
|
|
255
|
+
# Basic usage
|
|
256
|
+
client = Workflow()
|
|
257
|
+
|
|
258
|
+
result = client.workflowUpdateWorkflow(args=...)
|
|
259
|
+
print(f"Result: {result}")
|
|
260
|
+
|
|
261
|
+
# With detailed data
|
|
262
|
+
data = {
|
|
263
|
+
'name': 'My Resource',
|
|
264
|
+
'description': 'Resource description',
|
|
265
|
+
'attributes': {
|
|
266
|
+
'key1': 'value1',
|
|
267
|
+
'key2': 'value2'
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
result = client.workflowUpdateWorkflow(data)
|
|
272
|
+
print(f"Created/Updated: {result['guid']}")
|
|
273
|
+
|
|
274
|
+
Use Cases:
|
|
275
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
276
|
+
- Ownership Changes: Reassign data ownership
|
|
277
|
+
- Classification: Apply or modify data classifications
|
|
278
|
+
"""
|
|
279
|
+
self.method = 'PUT'
|
|
280
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['update_workflow'],
|
|
281
|
+
workflowId=args['--workflowId'])
|
|
282
|
+
self.params = get_api_version_params('workflow')
|
|
283
|
+
self.payload = get_json(args, '--payloadFile')
|
|
284
|
+
|
|
285
|
+
@decorator
|
|
286
|
+
def workflowDeleteWorkflow(self, args):
|
|
287
|
+
"""
|
|
288
|
+
Delete a workflow.
|
|
289
|
+
|
|
290
|
+
Permanently deletes the specified workflow.
|
|
291
|
+
This operation cannot be undone. Use with caution.
|
|
292
|
+
|
|
293
|
+
Args:
|
|
294
|
+
args: Dictionary of operation arguments.
|
|
295
|
+
Contains operation-specific parameters.
|
|
296
|
+
See method implementation for details.
|
|
297
|
+
|
|
298
|
+
Returns:
|
|
299
|
+
Dictionary with deletion status:
|
|
300
|
+
{
|
|
301
|
+
'guid': str, # Deleted resource ID
|
|
302
|
+
'status': str, # Deletion status
|
|
303
|
+
'message': str # Confirmation message
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
Raises:
|
|
307
|
+
ValueError: When required parameters are missing or invalid:
|
|
308
|
+
- Empty or None values for required fields
|
|
309
|
+
- Invalid GUID format
|
|
310
|
+
- Out-of-range values
|
|
311
|
+
|
|
312
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
313
|
+
- DefaultAzureCredential not configured
|
|
314
|
+
- Insufficient permissions
|
|
315
|
+
- Expired authentication token
|
|
316
|
+
|
|
317
|
+
HTTPError: When Purview API returns error:
|
|
318
|
+
- 400: Bad request (invalid parameters)
|
|
319
|
+
- 401: Unauthorized (authentication failed)
|
|
320
|
+
- 403: Forbidden (insufficient permissions)
|
|
321
|
+
- 404: Resource not found
|
|
322
|
+
- 429: Rate limit exceeded
|
|
323
|
+
- 500: Internal server error
|
|
324
|
+
|
|
325
|
+
NetworkError: When network connectivity fails
|
|
326
|
+
|
|
327
|
+
Example:
|
|
328
|
+
# Basic usage
|
|
329
|
+
client = Workflow()
|
|
330
|
+
|
|
331
|
+
result = client.workflowDeleteWorkflow(args=...)
|
|
332
|
+
print(f"Result: {result}")
|
|
333
|
+
|
|
334
|
+
Use Cases:
|
|
335
|
+
- Data Cleanup: Remove obsolete or test data
|
|
336
|
+
- Decommissioning: Delete resources no longer in use
|
|
337
|
+
- Testing: Clean up test environments
|
|
338
|
+
"""
|
|
339
|
+
self.method = 'DELETE'
|
|
340
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['delete_workflow'],
|
|
341
|
+
workflowId=args['--workflowId'])
|
|
342
|
+
self.params = get_api_version_params('workflow')
|
|
343
|
+
|
|
344
|
+
# ========== Workflow Execution ==========
|
|
345
|
+
|
|
346
|
+
@decorator
|
|
347
|
+
def workflowExecuteWorkflow(self, args):
|
|
348
|
+
"""
|
|
349
|
+
Perform operation on resource.
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
Args:
|
|
354
|
+
args: Dictionary of operation arguments.
|
|
355
|
+
Contains operation-specific parameters.
|
|
356
|
+
See method implementation for details.
|
|
357
|
+
|
|
358
|
+
Returns:
|
|
359
|
+
[TODO: Specify return type and structure]
|
|
360
|
+
[TODO: Document nested fields]
|
|
361
|
+
|
|
362
|
+
Raises:
|
|
363
|
+
ValueError: When required parameters are missing or invalid:
|
|
364
|
+
- Empty or None values for required fields
|
|
365
|
+
- Invalid GUID format
|
|
366
|
+
- Out-of-range values
|
|
367
|
+
|
|
368
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
369
|
+
- DefaultAzureCredential not configured
|
|
370
|
+
- Insufficient permissions
|
|
371
|
+
- Expired authentication token
|
|
372
|
+
|
|
373
|
+
HTTPError: When Purview API returns error:
|
|
374
|
+
- 400: Bad request (invalid parameters)
|
|
375
|
+
- 401: Unauthorized (authentication failed)
|
|
376
|
+
- 403: Forbidden (insufficient permissions)
|
|
377
|
+
- 404: Resource not found
|
|
378
|
+
- 429: Rate limit exceeded
|
|
379
|
+
- 500: Internal server error
|
|
380
|
+
|
|
381
|
+
NetworkError: When network connectivity fails
|
|
382
|
+
|
|
383
|
+
Example:
|
|
384
|
+
# Basic usage
|
|
385
|
+
client = Workflow()
|
|
386
|
+
|
|
387
|
+
result = client.workflowExecuteWorkflow(args=...)
|
|
388
|
+
print(f"Result: {result}")
|
|
389
|
+
|
|
390
|
+
Use Cases:
|
|
391
|
+
- [TODO: Add specific use cases for this operation]
|
|
392
|
+
- [TODO: Include business context]
|
|
393
|
+
- [TODO: Explain when to use this method]
|
|
394
|
+
"""
|
|
395
|
+
self.method = 'POST'
|
|
396
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['execute_workflow'],
|
|
397
|
+
workflowId=args['--workflowId'])
|
|
398
|
+
self.params = get_api_version_params('workflow')
|
|
399
|
+
self.payload = get_json(args, '--payloadFile') if args.get('--payloadFile') else {}
|
|
400
|
+
|
|
401
|
+
@decorator
|
|
402
|
+
def workflowGetWorkflowExecution(self, args):
|
|
403
|
+
"""
|
|
404
|
+
Retrieve workflow information.
|
|
405
|
+
|
|
406
|
+
Retrieves detailed information about the specified workflow.
|
|
407
|
+
Returns complete workflow metadata and properties.
|
|
408
|
+
|
|
409
|
+
Args:
|
|
410
|
+
args: Dictionary of operation arguments.
|
|
411
|
+
Contains operation-specific parameters.
|
|
412
|
+
See method implementation for details.
|
|
413
|
+
|
|
414
|
+
Returns:
|
|
415
|
+
Dictionary containing workflow information:
|
|
416
|
+
{
|
|
417
|
+
'guid': str, # Unique identifier
|
|
418
|
+
'name': str, # Resource name
|
|
419
|
+
'attributes': dict, # Resource attributes
|
|
420
|
+
'status': str, # Resource status
|
|
421
|
+
'updateTime': int # Last update timestamp
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
Raises:
|
|
425
|
+
ValueError: When required parameters are missing or invalid:
|
|
426
|
+
- Empty or None values for required fields
|
|
427
|
+
- Invalid GUID format
|
|
428
|
+
- Out-of-range values
|
|
429
|
+
|
|
430
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
431
|
+
- DefaultAzureCredential not configured
|
|
432
|
+
- Insufficient permissions
|
|
433
|
+
- Expired authentication token
|
|
434
|
+
|
|
435
|
+
HTTPError: When Purview API returns error:
|
|
436
|
+
- 400: Bad request (invalid parameters)
|
|
437
|
+
- 401: Unauthorized (authentication failed)
|
|
438
|
+
- 403: Forbidden (insufficient permissions)
|
|
439
|
+
- 404: Resource not found
|
|
440
|
+
- 429: Rate limit exceeded
|
|
441
|
+
- 500: Internal server error
|
|
442
|
+
|
|
443
|
+
NetworkError: When network connectivity fails
|
|
444
|
+
|
|
445
|
+
Example:
|
|
446
|
+
# Basic usage
|
|
447
|
+
client = Workflow()
|
|
448
|
+
|
|
449
|
+
result = client.workflowGetWorkflowExecution(args=...)
|
|
450
|
+
print(f"Result: {result}")
|
|
451
|
+
|
|
452
|
+
Use Cases:
|
|
453
|
+
- Data Discovery: Find and explore data assets
|
|
454
|
+
- Compliance Auditing: Review metadata and classifications
|
|
455
|
+
- Reporting: Generate catalog reports
|
|
456
|
+
"""
|
|
457
|
+
self.method = 'GET'
|
|
458
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_execution'],
|
|
459
|
+
workflowId=args['--workflowId'],
|
|
460
|
+
executionId=args['--executionId'])
|
|
461
|
+
self.params = get_api_version_params('workflow')
|
|
462
|
+
|
|
463
|
+
@decorator
|
|
464
|
+
def workflowListWorkflowExecutions(self, args):
|
|
465
|
+
"""
|
|
466
|
+
Retrieve workflow information.
|
|
467
|
+
|
|
468
|
+
Retrieves detailed information about the specified workflow.
|
|
469
|
+
Returns complete workflow metadata and properties.
|
|
470
|
+
|
|
471
|
+
Args:
|
|
472
|
+
args: Dictionary of operation arguments.
|
|
473
|
+
Contains operation-specific parameters.
|
|
474
|
+
See method implementation for details.
|
|
475
|
+
|
|
476
|
+
Returns:
|
|
477
|
+
List of resource dictionaries, each containing:
|
|
478
|
+
- guid (str): Unique identifier
|
|
479
|
+
- name (str): Resource name
|
|
480
|
+
- attributes (dict): Resource attributes
|
|
481
|
+
- status (str): Resource status
|
|
482
|
+
|
|
483
|
+
Returns empty list if no resources found.
|
|
484
|
+
|
|
485
|
+
Raises:
|
|
486
|
+
ValueError: When required parameters are missing or invalid:
|
|
487
|
+
- Empty or None values for required fields
|
|
488
|
+
- Invalid GUID format
|
|
489
|
+
- Out-of-range values
|
|
490
|
+
|
|
491
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
492
|
+
- DefaultAzureCredential not configured
|
|
493
|
+
- Insufficient permissions
|
|
494
|
+
- Expired authentication token
|
|
495
|
+
|
|
496
|
+
HTTPError: When Purview API returns error:
|
|
497
|
+
- 400: Bad request (invalid parameters)
|
|
498
|
+
- 401: Unauthorized (authentication failed)
|
|
499
|
+
- 403: Forbidden (insufficient permissions)
|
|
500
|
+
- 404: Resource not found
|
|
501
|
+
- 429: Rate limit exceeded
|
|
502
|
+
- 500: Internal server error
|
|
503
|
+
|
|
504
|
+
NetworkError: When network connectivity fails
|
|
505
|
+
|
|
506
|
+
Example:
|
|
507
|
+
# Basic usage
|
|
508
|
+
client = Workflow()
|
|
509
|
+
|
|
510
|
+
result = client.workflowListWorkflowExecutions(args=...)
|
|
511
|
+
print(f"Result: {result}")
|
|
512
|
+
|
|
513
|
+
Use Cases:
|
|
514
|
+
- Data Discovery: Find and explore data assets
|
|
515
|
+
- Compliance Auditing: Review metadata and classifications
|
|
516
|
+
- Reporting: Generate catalog reports
|
|
517
|
+
"""
|
|
518
|
+
self.method = 'GET'
|
|
519
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_executions'],
|
|
520
|
+
workflowId=args['--workflowId'])
|
|
521
|
+
self.params = get_api_version_params('workflow')
|
|
522
|
+
|
|
523
|
+
@decorator
|
|
524
|
+
def workflowCancelWorkflowExecution(self, args):
|
|
525
|
+
"""
|
|
526
|
+
Perform operation on resource.
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
Args:
|
|
531
|
+
args: Dictionary of operation arguments.
|
|
532
|
+
Contains operation-specific parameters.
|
|
533
|
+
See method implementation for details.
|
|
534
|
+
|
|
535
|
+
Returns:
|
|
536
|
+
[TODO: Specify return type and structure]
|
|
537
|
+
[TODO: Document nested fields]
|
|
538
|
+
|
|
539
|
+
Raises:
|
|
540
|
+
ValueError: When required parameters are missing or invalid:
|
|
541
|
+
- Empty or None values for required fields
|
|
542
|
+
- Invalid GUID format
|
|
543
|
+
- Out-of-range values
|
|
544
|
+
|
|
545
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
546
|
+
- DefaultAzureCredential not configured
|
|
547
|
+
- Insufficient permissions
|
|
548
|
+
- Expired authentication token
|
|
549
|
+
|
|
550
|
+
HTTPError: When Purview API returns error:
|
|
551
|
+
- 400: Bad request (invalid parameters)
|
|
552
|
+
- 401: Unauthorized (authentication failed)
|
|
553
|
+
- 403: Forbidden (insufficient permissions)
|
|
554
|
+
- 404: Resource not found
|
|
555
|
+
- 429: Rate limit exceeded
|
|
556
|
+
- 500: Internal server error
|
|
557
|
+
|
|
558
|
+
NetworkError: When network connectivity fails
|
|
559
|
+
|
|
560
|
+
Example:
|
|
561
|
+
# Basic usage
|
|
562
|
+
client = Workflow()
|
|
563
|
+
|
|
564
|
+
result = client.workflowCancelWorkflowExecution(args=...)
|
|
565
|
+
print(f"Result: {result}")
|
|
566
|
+
|
|
567
|
+
Use Cases:
|
|
568
|
+
- [TODO: Add specific use cases for this operation]
|
|
569
|
+
- [TODO: Include business context]
|
|
570
|
+
- [TODO: Explain when to use this method]
|
|
571
|
+
"""
|
|
572
|
+
self.method = 'POST'
|
|
573
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['cancel_workflow_execution'],
|
|
574
|
+
workflowId=args['--workflowId'],
|
|
575
|
+
executionId=args['--executionId'])
|
|
576
|
+
self.params = get_api_version_params('workflow')
|
|
577
|
+
|
|
578
|
+
# ========== Workflow Runs and History ==========
|
|
579
|
+
|
|
580
|
+
@decorator
|
|
581
|
+
def workflowGetWorkflowRuns(self, args):
|
|
582
|
+
"""
|
|
583
|
+
Retrieve workflow information.
|
|
584
|
+
|
|
585
|
+
Retrieves detailed information about the specified workflow.
|
|
586
|
+
Returns complete workflow metadata and properties.
|
|
587
|
+
|
|
588
|
+
Args:
|
|
589
|
+
args: Dictionary of operation arguments.
|
|
590
|
+
Contains operation-specific parameters.
|
|
591
|
+
See method implementation for details.
|
|
592
|
+
|
|
593
|
+
Returns:
|
|
594
|
+
Dictionary containing workflow information:
|
|
595
|
+
{
|
|
596
|
+
'guid': str, # Unique identifier
|
|
597
|
+
'name': str, # Resource name
|
|
598
|
+
'attributes': dict, # Resource attributes
|
|
599
|
+
'status': str, # Resource status
|
|
600
|
+
'updateTime': int # Last update timestamp
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
Raises:
|
|
604
|
+
ValueError: When required parameters are missing or invalid:
|
|
605
|
+
- Empty or None values for required fields
|
|
606
|
+
- Invalid GUID format
|
|
607
|
+
- Out-of-range values
|
|
608
|
+
|
|
609
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
610
|
+
- DefaultAzureCredential not configured
|
|
611
|
+
- Insufficient permissions
|
|
612
|
+
- Expired authentication token
|
|
613
|
+
|
|
614
|
+
HTTPError: When Purview API returns error:
|
|
615
|
+
- 400: Bad request (invalid parameters)
|
|
616
|
+
- 401: Unauthorized (authentication failed)
|
|
617
|
+
- 403: Forbidden (insufficient permissions)
|
|
618
|
+
- 404: Resource not found
|
|
619
|
+
- 429: Rate limit exceeded
|
|
620
|
+
- 500: Internal server error
|
|
621
|
+
|
|
622
|
+
NetworkError: When network connectivity fails
|
|
623
|
+
|
|
624
|
+
Example:
|
|
625
|
+
# Basic usage
|
|
626
|
+
client = Workflow()
|
|
627
|
+
|
|
628
|
+
result = client.workflowGetWorkflowRuns(args=...)
|
|
629
|
+
print(f"Result: {result}")
|
|
630
|
+
|
|
631
|
+
Use Cases:
|
|
632
|
+
- Data Discovery: Find and explore data assets
|
|
633
|
+
- Compliance Auditing: Review metadata and classifications
|
|
634
|
+
- Reporting: Generate catalog reports
|
|
635
|
+
"""
|
|
636
|
+
self.method = 'GET'
|
|
637
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_runs'],
|
|
638
|
+
workflowId=args['--workflowId'])
|
|
639
|
+
self.params = get_api_version_params('workflow')
|
|
640
|
+
if args.get('--status'):
|
|
641
|
+
self.params['status'] = args['--status']
|
|
642
|
+
if args.get('--startTime'):
|
|
643
|
+
self.params['startTime'] = args['--startTime']
|
|
644
|
+
if args.get('--endTime'):
|
|
645
|
+
self.params['endTime'] = args['--endTime']
|
|
646
|
+
|
|
647
|
+
@decorator
|
|
648
|
+
def workflowGetWorkflowRunDetails(self, args):
|
|
649
|
+
"""
|
|
650
|
+
Retrieve workflow information.
|
|
651
|
+
|
|
652
|
+
Retrieves detailed information about the specified workflow.
|
|
653
|
+
Returns complete workflow metadata and properties.
|
|
654
|
+
|
|
655
|
+
Args:
|
|
656
|
+
args: Dictionary of operation arguments.
|
|
657
|
+
Contains operation-specific parameters.
|
|
658
|
+
See method implementation for details.
|
|
659
|
+
|
|
660
|
+
Returns:
|
|
661
|
+
Dictionary containing workflow information:
|
|
662
|
+
{
|
|
663
|
+
'guid': str, # Unique identifier
|
|
664
|
+
'name': str, # Resource name
|
|
665
|
+
'attributes': dict, # Resource attributes
|
|
666
|
+
'status': str, # Resource status
|
|
667
|
+
'updateTime': int # Last update timestamp
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
Raises:
|
|
671
|
+
ValueError: When required parameters are missing or invalid:
|
|
672
|
+
- Empty or None values for required fields
|
|
673
|
+
- Invalid GUID format
|
|
674
|
+
- Out-of-range values
|
|
675
|
+
|
|
676
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
677
|
+
- DefaultAzureCredential not configured
|
|
678
|
+
- Insufficient permissions
|
|
679
|
+
- Expired authentication token
|
|
680
|
+
|
|
681
|
+
HTTPError: When Purview API returns error:
|
|
682
|
+
- 400: Bad request (invalid parameters)
|
|
683
|
+
- 401: Unauthorized (authentication failed)
|
|
684
|
+
- 403: Forbidden (insufficient permissions)
|
|
685
|
+
- 404: Resource not found
|
|
686
|
+
- 429: Rate limit exceeded
|
|
687
|
+
- 500: Internal server error
|
|
688
|
+
|
|
689
|
+
NetworkError: When network connectivity fails
|
|
690
|
+
|
|
691
|
+
Example:
|
|
692
|
+
# Basic usage
|
|
693
|
+
client = Workflow()
|
|
694
|
+
|
|
695
|
+
result = client.workflowGetWorkflowRunDetails(args=...)
|
|
696
|
+
print(f"Result: {result}")
|
|
697
|
+
|
|
698
|
+
Use Cases:
|
|
699
|
+
- Data Discovery: Find and explore data assets
|
|
700
|
+
- Compliance Auditing: Review metadata and classifications
|
|
701
|
+
- Reporting: Generate catalog reports
|
|
702
|
+
"""
|
|
703
|
+
self.method = 'GET'
|
|
704
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_run'],
|
|
705
|
+
workflowId=args['--workflowId'],
|
|
706
|
+
runId=args['--runId'])
|
|
707
|
+
self.params = get_api_version_params('workflow')
|
|
708
|
+
|
|
709
|
+
@decorator
|
|
710
|
+
def workflowGetWorkflowHistory(self, args):
|
|
711
|
+
"""
|
|
712
|
+
Retrieve workflow information.
|
|
713
|
+
|
|
714
|
+
Retrieves detailed information about the specified workflow.
|
|
715
|
+
Returns complete workflow metadata and properties.
|
|
716
|
+
|
|
717
|
+
Args:
|
|
718
|
+
args: Dictionary of operation arguments.
|
|
719
|
+
Contains operation-specific parameters.
|
|
720
|
+
See method implementation for details.
|
|
721
|
+
|
|
722
|
+
Returns:
|
|
723
|
+
Dictionary containing workflow information:
|
|
724
|
+
{
|
|
725
|
+
'guid': str, # Unique identifier
|
|
726
|
+
'name': str, # Resource name
|
|
727
|
+
'attributes': dict, # Resource attributes
|
|
728
|
+
'status': str, # Resource status
|
|
729
|
+
'updateTime': int # Last update timestamp
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
Raises:
|
|
733
|
+
ValueError: When required parameters are missing or invalid:
|
|
734
|
+
- Empty or None values for required fields
|
|
735
|
+
- Invalid GUID format
|
|
736
|
+
- Out-of-range values
|
|
737
|
+
|
|
738
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
739
|
+
- DefaultAzureCredential not configured
|
|
740
|
+
- Insufficient permissions
|
|
741
|
+
- Expired authentication token
|
|
742
|
+
|
|
743
|
+
HTTPError: When Purview API returns error:
|
|
744
|
+
- 400: Bad request (invalid parameters)
|
|
745
|
+
- 401: Unauthorized (authentication failed)
|
|
746
|
+
- 403: Forbidden (insufficient permissions)
|
|
747
|
+
- 404: Resource not found
|
|
748
|
+
- 429: Rate limit exceeded
|
|
749
|
+
- 500: Internal server error
|
|
750
|
+
|
|
751
|
+
NetworkError: When network connectivity fails
|
|
752
|
+
|
|
753
|
+
Example:
|
|
754
|
+
# Basic usage
|
|
755
|
+
client = Workflow()
|
|
756
|
+
|
|
757
|
+
result = client.workflowGetWorkflowHistory(args=...)
|
|
758
|
+
print(f"Result: {result}")
|
|
759
|
+
|
|
760
|
+
Use Cases:
|
|
761
|
+
- Data Discovery: Find and explore data assets
|
|
762
|
+
- Compliance Auditing: Review metadata and classifications
|
|
763
|
+
- Reporting: Generate catalog reports
|
|
764
|
+
"""
|
|
765
|
+
self.method = 'GET'
|
|
766
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_history'],
|
|
767
|
+
workflowId=args['--workflowId'])
|
|
768
|
+
self.params = get_api_version_params('workflow')
|
|
769
|
+
|
|
770
|
+
# ========== Workflow Templates ==========
|
|
771
|
+
|
|
772
|
+
@decorator
|
|
773
|
+
def workflowListWorkflowTemplates(self, args):
|
|
774
|
+
"""
|
|
775
|
+
Retrieve workflow information.
|
|
776
|
+
|
|
777
|
+
Retrieves detailed information about the specified workflow.
|
|
778
|
+
Returns complete workflow metadata and properties.
|
|
779
|
+
|
|
780
|
+
Args:
|
|
781
|
+
args: Dictionary of operation arguments.
|
|
782
|
+
Contains operation-specific parameters.
|
|
783
|
+
See method implementation for details.
|
|
784
|
+
|
|
785
|
+
Returns:
|
|
786
|
+
List of resource dictionaries, each containing:
|
|
787
|
+
- guid (str): Unique identifier
|
|
788
|
+
- name (str): Resource name
|
|
789
|
+
- attributes (dict): Resource attributes
|
|
790
|
+
- status (str): Resource status
|
|
791
|
+
|
|
792
|
+
Returns empty list if no resources found.
|
|
793
|
+
|
|
794
|
+
Raises:
|
|
795
|
+
ValueError: When required parameters are missing or invalid:
|
|
796
|
+
- Empty or None values for required fields
|
|
797
|
+
- Invalid GUID format
|
|
798
|
+
- Out-of-range values
|
|
799
|
+
|
|
800
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
801
|
+
- DefaultAzureCredential not configured
|
|
802
|
+
- Insufficient permissions
|
|
803
|
+
- Expired authentication token
|
|
804
|
+
|
|
805
|
+
HTTPError: When Purview API returns error:
|
|
806
|
+
- 400: Bad request (invalid parameters)
|
|
807
|
+
- 401: Unauthorized (authentication failed)
|
|
808
|
+
- 403: Forbidden (insufficient permissions)
|
|
809
|
+
- 404: Resource not found
|
|
810
|
+
- 429: Rate limit exceeded
|
|
811
|
+
- 500: Internal server error
|
|
812
|
+
|
|
813
|
+
NetworkError: When network connectivity fails
|
|
814
|
+
|
|
815
|
+
Example:
|
|
816
|
+
# Basic usage
|
|
817
|
+
client = Workflow()
|
|
818
|
+
|
|
819
|
+
result = client.workflowListWorkflowTemplates(args=...)
|
|
820
|
+
print(f"Result: {result}")
|
|
821
|
+
|
|
822
|
+
Use Cases:
|
|
823
|
+
- Data Discovery: Find and explore data assets
|
|
824
|
+
- Compliance Auditing: Review metadata and classifications
|
|
825
|
+
- Reporting: Generate catalog reports
|
|
826
|
+
"""
|
|
827
|
+
self.method = 'GET'
|
|
828
|
+
self.endpoint = ENDPOINTS['workflow']['workflow_templates']
|
|
829
|
+
self.params = get_api_version_params('workflow')
|
|
830
|
+
|
|
831
|
+
@decorator
|
|
832
|
+
def workflowGetWorkflowTemplate(self, args):
|
|
833
|
+
"""
|
|
834
|
+
Retrieve workflow information.
|
|
835
|
+
|
|
836
|
+
Retrieves detailed information about the specified workflow.
|
|
837
|
+
Returns complete workflow metadata and properties.
|
|
838
|
+
|
|
839
|
+
Args:
|
|
840
|
+
args: Dictionary of operation arguments.
|
|
841
|
+
Contains operation-specific parameters.
|
|
842
|
+
See method implementation for details.
|
|
843
|
+
|
|
844
|
+
Returns:
|
|
845
|
+
Dictionary containing workflow information:
|
|
846
|
+
{
|
|
847
|
+
'guid': str, # Unique identifier
|
|
848
|
+
'name': str, # Resource name
|
|
849
|
+
'attributes': dict, # Resource attributes
|
|
850
|
+
'status': str, # Resource status
|
|
851
|
+
'updateTime': int # Last update timestamp
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
Raises:
|
|
855
|
+
ValueError: When required parameters are missing or invalid:
|
|
856
|
+
- Empty or None values for required fields
|
|
857
|
+
- Invalid GUID format
|
|
858
|
+
- Out-of-range values
|
|
859
|
+
|
|
860
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
861
|
+
- DefaultAzureCredential not configured
|
|
862
|
+
- Insufficient permissions
|
|
863
|
+
- Expired authentication token
|
|
864
|
+
|
|
865
|
+
HTTPError: When Purview API returns error:
|
|
866
|
+
- 400: Bad request (invalid parameters)
|
|
867
|
+
- 401: Unauthorized (authentication failed)
|
|
868
|
+
- 403: Forbidden (insufficient permissions)
|
|
869
|
+
- 404: Resource not found
|
|
870
|
+
- 429: Rate limit exceeded
|
|
871
|
+
- 500: Internal server error
|
|
872
|
+
|
|
873
|
+
NetworkError: When network connectivity fails
|
|
874
|
+
|
|
875
|
+
Example:
|
|
876
|
+
# Basic usage
|
|
877
|
+
client = Workflow()
|
|
878
|
+
|
|
879
|
+
result = client.workflowGetWorkflowTemplate(args=...)
|
|
880
|
+
print(f"Result: {result}")
|
|
881
|
+
|
|
882
|
+
Use Cases:
|
|
883
|
+
- Data Discovery: Find and explore data assets
|
|
884
|
+
- Compliance Auditing: Review metadata and classifications
|
|
885
|
+
- Reporting: Generate catalog reports
|
|
886
|
+
"""
|
|
887
|
+
self.method = 'GET'
|
|
888
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_template'],
|
|
889
|
+
templateId=args['--templateId'])
|
|
890
|
+
self.params = get_api_version_params('workflow')
|
|
891
|
+
|
|
892
|
+
@decorator
|
|
893
|
+
def workflowCreateWorkflowFromTemplate(self, args):
|
|
894
|
+
"""
|
|
895
|
+
Create a new workflow.
|
|
896
|
+
|
|
897
|
+
Creates a new workflow in Microsoft Purview Workflows. Automate governance tasks.
|
|
898
|
+
Requires appropriate permissions and valid workflow definition.
|
|
899
|
+
|
|
900
|
+
Args:
|
|
901
|
+
args: Dictionary of operation arguments.
|
|
902
|
+
Contains operation-specific parameters.
|
|
903
|
+
See method implementation for details.
|
|
904
|
+
|
|
905
|
+
Returns:
|
|
906
|
+
Dictionary containing created workflow:
|
|
907
|
+
{
|
|
908
|
+
'guid': str, # Unique identifier
|
|
909
|
+
'name': str, # Resource name
|
|
910
|
+
'status': str, # Creation status
|
|
911
|
+
'attributes': dict, # Resource attributes
|
|
912
|
+
'createTime': int # Creation timestamp
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
Raises:
|
|
916
|
+
ValueError: When required parameters are missing or invalid:
|
|
917
|
+
- Empty or None values for required fields
|
|
918
|
+
- Invalid GUID format
|
|
919
|
+
- Out-of-range values
|
|
920
|
+
|
|
921
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
922
|
+
- DefaultAzureCredential not configured
|
|
923
|
+
- Insufficient permissions
|
|
924
|
+
- Expired authentication token
|
|
925
|
+
|
|
926
|
+
HTTPError: When Purview API returns error:
|
|
927
|
+
- 400: Bad request (invalid parameters)
|
|
928
|
+
- 401: Unauthorized (authentication failed)
|
|
929
|
+
- 403: Forbidden (insufficient permissions)
|
|
930
|
+
- 404: Resource not found
|
|
931
|
+
- 409: Conflict (resource already exists)
|
|
932
|
+
- 429: Rate limit exceeded
|
|
933
|
+
- 500: Internal server error
|
|
934
|
+
|
|
935
|
+
NetworkError: When network connectivity fails
|
|
936
|
+
|
|
937
|
+
Example:
|
|
938
|
+
# Basic usage
|
|
939
|
+
client = Workflow()
|
|
940
|
+
|
|
941
|
+
result = client.workflowCreateWorkflowFromTemplate(args=...)
|
|
942
|
+
print(f"Result: {result}")
|
|
943
|
+
|
|
944
|
+
# With detailed data
|
|
945
|
+
data = {
|
|
946
|
+
'name': 'My Resource',
|
|
947
|
+
'description': 'Resource description',
|
|
948
|
+
'attributes': {
|
|
949
|
+
'key1': 'value1',
|
|
950
|
+
'key2': 'value2'
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
result = client.workflowCreateWorkflowFromTemplate(data)
|
|
955
|
+
print(f"Created/Updated: {result['guid']}")
|
|
956
|
+
|
|
957
|
+
Use Cases:
|
|
958
|
+
- Data Onboarding: Register new data sources in catalog
|
|
959
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
960
|
+
- Automation: Programmatically populate catalog
|
|
961
|
+
"""
|
|
962
|
+
self.method = 'POST'
|
|
963
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['create_from_template'],
|
|
964
|
+
templateId=args['--templateId'])
|
|
965
|
+
self.params = get_api_version_params('workflow')
|
|
966
|
+
self.payload = get_json(args, '--payloadFile')
|
|
967
|
+
|
|
968
|
+
# ========== Workflow Tasks and Steps ==========
|
|
969
|
+
|
|
970
|
+
@decorator
|
|
971
|
+
def workflowGetWorkflowTasks(self, args):
|
|
972
|
+
"""
|
|
973
|
+
Retrieve workflow information.
|
|
974
|
+
|
|
975
|
+
Retrieves detailed information about the specified workflow.
|
|
976
|
+
Returns complete workflow metadata and properties.
|
|
977
|
+
|
|
978
|
+
Args:
|
|
979
|
+
args: Dictionary of operation arguments.
|
|
980
|
+
Contains operation-specific parameters.
|
|
981
|
+
See method implementation for details.
|
|
982
|
+
|
|
983
|
+
Returns:
|
|
984
|
+
Dictionary containing workflow information:
|
|
985
|
+
{
|
|
986
|
+
'guid': str, # Unique identifier
|
|
987
|
+
'name': str, # Resource name
|
|
988
|
+
'attributes': dict, # Resource attributes
|
|
989
|
+
'status': str, # Resource status
|
|
990
|
+
'updateTime': int # Last update timestamp
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
Raises:
|
|
994
|
+
ValueError: When required parameters are missing or invalid:
|
|
995
|
+
- Empty or None values for required fields
|
|
996
|
+
- Invalid GUID format
|
|
997
|
+
- Out-of-range values
|
|
998
|
+
|
|
999
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1000
|
+
- DefaultAzureCredential not configured
|
|
1001
|
+
- Insufficient permissions
|
|
1002
|
+
- Expired authentication token
|
|
1003
|
+
|
|
1004
|
+
HTTPError: When Purview API returns error:
|
|
1005
|
+
- 400: Bad request (invalid parameters)
|
|
1006
|
+
- 401: Unauthorized (authentication failed)
|
|
1007
|
+
- 403: Forbidden (insufficient permissions)
|
|
1008
|
+
- 404: Resource not found
|
|
1009
|
+
- 429: Rate limit exceeded
|
|
1010
|
+
- 500: Internal server error
|
|
1011
|
+
|
|
1012
|
+
NetworkError: When network connectivity fails
|
|
1013
|
+
|
|
1014
|
+
Example:
|
|
1015
|
+
# Basic usage
|
|
1016
|
+
client = Workflow()
|
|
1017
|
+
|
|
1018
|
+
result = client.workflowGetWorkflowTasks(args=...)
|
|
1019
|
+
print(f"Result: {result}")
|
|
1020
|
+
|
|
1021
|
+
Use Cases:
|
|
1022
|
+
- Data Discovery: Find and explore data assets
|
|
1023
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1024
|
+
- Reporting: Generate catalog reports
|
|
1025
|
+
"""
|
|
1026
|
+
self.method = 'GET'
|
|
1027
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_tasks'],
|
|
1028
|
+
workflowId=args['--workflowId'])
|
|
1029
|
+
self.params = get_api_version_params('workflow')
|
|
1030
|
+
|
|
1031
|
+
@decorator
|
|
1032
|
+
def workflowGetWorkflowTask(self, args):
|
|
1033
|
+
"""
|
|
1034
|
+
Retrieve workflow information.
|
|
1035
|
+
|
|
1036
|
+
Retrieves detailed information about the specified workflow.
|
|
1037
|
+
Returns complete workflow metadata and properties.
|
|
1038
|
+
|
|
1039
|
+
Args:
|
|
1040
|
+
args: Dictionary of operation arguments.
|
|
1041
|
+
Contains operation-specific parameters.
|
|
1042
|
+
See method implementation for details.
|
|
1043
|
+
|
|
1044
|
+
Returns:
|
|
1045
|
+
Dictionary containing workflow information:
|
|
1046
|
+
{
|
|
1047
|
+
'guid': str, # Unique identifier
|
|
1048
|
+
'name': str, # Resource name
|
|
1049
|
+
'attributes': dict, # Resource attributes
|
|
1050
|
+
'status': str, # Resource status
|
|
1051
|
+
'updateTime': int # Last update timestamp
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
Raises:
|
|
1055
|
+
ValueError: When required parameters are missing or invalid:
|
|
1056
|
+
- Empty or None values for required fields
|
|
1057
|
+
- Invalid GUID format
|
|
1058
|
+
- Out-of-range values
|
|
1059
|
+
|
|
1060
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1061
|
+
- DefaultAzureCredential not configured
|
|
1062
|
+
- Insufficient permissions
|
|
1063
|
+
- Expired authentication token
|
|
1064
|
+
|
|
1065
|
+
HTTPError: When Purview API returns error:
|
|
1066
|
+
- 400: Bad request (invalid parameters)
|
|
1067
|
+
- 401: Unauthorized (authentication failed)
|
|
1068
|
+
- 403: Forbidden (insufficient permissions)
|
|
1069
|
+
- 404: Resource not found
|
|
1070
|
+
- 429: Rate limit exceeded
|
|
1071
|
+
- 500: Internal server error
|
|
1072
|
+
|
|
1073
|
+
NetworkError: When network connectivity fails
|
|
1074
|
+
|
|
1075
|
+
Example:
|
|
1076
|
+
# Basic usage
|
|
1077
|
+
client = Workflow()
|
|
1078
|
+
|
|
1079
|
+
result = client.workflowGetWorkflowTask(args=...)
|
|
1080
|
+
print(f"Result: {result}")
|
|
1081
|
+
|
|
1082
|
+
Use Cases:
|
|
1083
|
+
- Data Discovery: Find and explore data assets
|
|
1084
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1085
|
+
- Reporting: Generate catalog reports
|
|
1086
|
+
"""
|
|
1087
|
+
self.method = 'GET'
|
|
1088
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_task'],
|
|
1089
|
+
workflowId=args['--workflowId'],
|
|
1090
|
+
taskId=args['--taskId'])
|
|
1091
|
+
self.params = get_api_version_params('workflow')
|
|
1092
|
+
|
|
1093
|
+
@decorator
|
|
1094
|
+
def workflowUpdateWorkflowTask(self, args):
|
|
1095
|
+
"""
|
|
1096
|
+
Update an existing workflow.
|
|
1097
|
+
|
|
1098
|
+
Updates an existing workflow with new values.
|
|
1099
|
+
Only specified fields are modified; others remain unchanged.
|
|
1100
|
+
|
|
1101
|
+
Args:
|
|
1102
|
+
args: Dictionary of operation arguments.
|
|
1103
|
+
Contains operation-specific parameters.
|
|
1104
|
+
See method implementation for details.
|
|
1105
|
+
|
|
1106
|
+
Returns:
|
|
1107
|
+
Dictionary containing updated workflow:
|
|
1108
|
+
{
|
|
1109
|
+
'guid': str, # Unique identifier
|
|
1110
|
+
'attributes': dict, # Updated attributes
|
|
1111
|
+
'updateTime': int # Update timestamp
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
Raises:
|
|
1115
|
+
ValueError: When required parameters are missing or invalid:
|
|
1116
|
+
- Empty or None values for required fields
|
|
1117
|
+
- Invalid GUID format
|
|
1118
|
+
- Out-of-range values
|
|
1119
|
+
|
|
1120
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1121
|
+
- DefaultAzureCredential not configured
|
|
1122
|
+
- Insufficient permissions
|
|
1123
|
+
- Expired authentication token
|
|
1124
|
+
|
|
1125
|
+
HTTPError: When Purview API returns error:
|
|
1126
|
+
- 400: Bad request (invalid parameters)
|
|
1127
|
+
- 401: Unauthorized (authentication failed)
|
|
1128
|
+
- 403: Forbidden (insufficient permissions)
|
|
1129
|
+
- 404: Resource not found
|
|
1130
|
+
- 429: Rate limit exceeded
|
|
1131
|
+
- 500: Internal server error
|
|
1132
|
+
|
|
1133
|
+
NetworkError: When network connectivity fails
|
|
1134
|
+
|
|
1135
|
+
Example:
|
|
1136
|
+
# Basic usage
|
|
1137
|
+
client = Workflow()
|
|
1138
|
+
|
|
1139
|
+
result = client.workflowUpdateWorkflowTask(args=...)
|
|
1140
|
+
print(f"Result: {result}")
|
|
1141
|
+
|
|
1142
|
+
# With detailed data
|
|
1143
|
+
data = {
|
|
1144
|
+
'name': 'My Resource',
|
|
1145
|
+
'description': 'Resource description',
|
|
1146
|
+
'attributes': {
|
|
1147
|
+
'key1': 'value1',
|
|
1148
|
+
'key2': 'value2'
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
result = client.workflowUpdateWorkflowTask(data)
|
|
1153
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1154
|
+
|
|
1155
|
+
Use Cases:
|
|
1156
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
1157
|
+
- Ownership Changes: Reassign data ownership
|
|
1158
|
+
- Classification: Apply or modify data classifications
|
|
1159
|
+
"""
|
|
1160
|
+
self.method = 'PUT'
|
|
1161
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_task'],
|
|
1162
|
+
workflowId=args['--workflowId'],
|
|
1163
|
+
taskId=args['--taskId'])
|
|
1164
|
+
self.params = get_api_version_params('workflow')
|
|
1165
|
+
self.payload = get_json(args, '--payloadFile')
|
|
1166
|
+
|
|
1167
|
+
@decorator
|
|
1168
|
+
def workflowCompleteWorkflowTask(self, args):
|
|
1169
|
+
"""
|
|
1170
|
+
Perform operation on resource.
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
Args:
|
|
1175
|
+
args: Dictionary of operation arguments.
|
|
1176
|
+
Contains operation-specific parameters.
|
|
1177
|
+
See method implementation for details.
|
|
1178
|
+
|
|
1179
|
+
Returns:
|
|
1180
|
+
[TODO: Specify return type and structure]
|
|
1181
|
+
[TODO: Document nested fields]
|
|
1182
|
+
|
|
1183
|
+
Raises:
|
|
1184
|
+
ValueError: When required parameters are missing or invalid:
|
|
1185
|
+
- Empty or None values for required fields
|
|
1186
|
+
- Invalid GUID format
|
|
1187
|
+
- Out-of-range values
|
|
1188
|
+
|
|
1189
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1190
|
+
- DefaultAzureCredential not configured
|
|
1191
|
+
- Insufficient permissions
|
|
1192
|
+
- Expired authentication token
|
|
1193
|
+
|
|
1194
|
+
HTTPError: When Purview API returns error:
|
|
1195
|
+
- 400: Bad request (invalid parameters)
|
|
1196
|
+
- 401: Unauthorized (authentication failed)
|
|
1197
|
+
- 403: Forbidden (insufficient permissions)
|
|
1198
|
+
- 404: Resource not found
|
|
1199
|
+
- 429: Rate limit exceeded
|
|
1200
|
+
- 500: Internal server error
|
|
1201
|
+
|
|
1202
|
+
NetworkError: When network connectivity fails
|
|
1203
|
+
|
|
1204
|
+
Example:
|
|
1205
|
+
# Basic usage
|
|
1206
|
+
client = Workflow()
|
|
1207
|
+
|
|
1208
|
+
result = client.workflowCompleteWorkflowTask(args=...)
|
|
1209
|
+
print(f"Result: {result}")
|
|
1210
|
+
|
|
1211
|
+
Use Cases:
|
|
1212
|
+
- [TODO: Add specific use cases for this operation]
|
|
1213
|
+
- [TODO: Include business context]
|
|
1214
|
+
- [TODO: Explain when to use this method]
|
|
1215
|
+
"""
|
|
1216
|
+
self.method = 'POST'
|
|
1217
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['complete_task'],
|
|
1218
|
+
workflowId=args['--workflowId'],
|
|
1219
|
+
taskId=args['--taskId'])
|
|
1220
|
+
self.params = get_api_version_params('workflow')
|
|
1221
|
+
self.payload = get_json(args, '--payloadFile') if args.get('--payloadFile') else {}
|
|
1222
|
+
|
|
1223
|
+
# ========== Approval Workflows ==========
|
|
1224
|
+
|
|
1225
|
+
@decorator
|
|
1226
|
+
def workflowCreateApprovalWorkflow(self, args):
|
|
1227
|
+
"""
|
|
1228
|
+
Create a new workflow.
|
|
1229
|
+
|
|
1230
|
+
Creates a new workflow in Microsoft Purview Workflows. Automate governance tasks.
|
|
1231
|
+
Requires appropriate permissions and valid workflow definition.
|
|
1232
|
+
|
|
1233
|
+
Args:
|
|
1234
|
+
args: Dictionary of operation arguments.
|
|
1235
|
+
Contains operation-specific parameters.
|
|
1236
|
+
See method implementation for details.
|
|
1237
|
+
|
|
1238
|
+
Returns:
|
|
1239
|
+
Dictionary containing created workflow:
|
|
1240
|
+
{
|
|
1241
|
+
'guid': str, # Unique identifier
|
|
1242
|
+
'name': str, # Resource name
|
|
1243
|
+
'status': str, # Creation status
|
|
1244
|
+
'attributes': dict, # Resource attributes
|
|
1245
|
+
'createTime': int # Creation timestamp
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
Raises:
|
|
1249
|
+
ValueError: When required parameters are missing or invalid:
|
|
1250
|
+
- Empty or None values for required fields
|
|
1251
|
+
- Invalid GUID format
|
|
1252
|
+
- Out-of-range values
|
|
1253
|
+
|
|
1254
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1255
|
+
- DefaultAzureCredential not configured
|
|
1256
|
+
- Insufficient permissions
|
|
1257
|
+
- Expired authentication token
|
|
1258
|
+
|
|
1259
|
+
HTTPError: When Purview API returns error:
|
|
1260
|
+
- 400: Bad request (invalid parameters)
|
|
1261
|
+
- 401: Unauthorized (authentication failed)
|
|
1262
|
+
- 403: Forbidden (insufficient permissions)
|
|
1263
|
+
- 404: Resource not found
|
|
1264
|
+
- 409: Conflict (resource already exists)
|
|
1265
|
+
- 429: Rate limit exceeded
|
|
1266
|
+
- 500: Internal server error
|
|
1267
|
+
|
|
1268
|
+
NetworkError: When network connectivity fails
|
|
1269
|
+
|
|
1270
|
+
Example:
|
|
1271
|
+
# Basic usage
|
|
1272
|
+
client = Workflow()
|
|
1273
|
+
|
|
1274
|
+
result = client.workflowCreateApprovalWorkflow(args=...)
|
|
1275
|
+
print(f"Result: {result}")
|
|
1276
|
+
|
|
1277
|
+
# With detailed data
|
|
1278
|
+
data = {
|
|
1279
|
+
'name': 'My Resource',
|
|
1280
|
+
'description': 'Resource description',
|
|
1281
|
+
'attributes': {
|
|
1282
|
+
'key1': 'value1',
|
|
1283
|
+
'key2': 'value2'
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
result = client.workflowCreateApprovalWorkflow(data)
|
|
1288
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1289
|
+
|
|
1290
|
+
Use Cases:
|
|
1291
|
+
- Data Onboarding: Register new data sources in catalog
|
|
1292
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
1293
|
+
- Automation: Programmatically populate catalog
|
|
1294
|
+
"""
|
|
1295
|
+
self.method = 'POST'
|
|
1296
|
+
self.endpoint = ENDPOINTS['workflow']['create_approval_workflow']
|
|
1297
|
+
self.params = get_api_version_params('workflow')
|
|
1298
|
+
self.payload = get_json(args, '--payloadFile')
|
|
1299
|
+
|
|
1300
|
+
@decorator
|
|
1301
|
+
def workflowGetApprovalRequests(self, args):
|
|
1302
|
+
"""
|
|
1303
|
+
Retrieve workflow information.
|
|
1304
|
+
|
|
1305
|
+
Retrieves detailed information about the specified workflow.
|
|
1306
|
+
Returns complete workflow metadata and properties.
|
|
1307
|
+
|
|
1308
|
+
Args:
|
|
1309
|
+
args: Dictionary of operation arguments.
|
|
1310
|
+
Contains operation-specific parameters.
|
|
1311
|
+
See method implementation for details.
|
|
1312
|
+
|
|
1313
|
+
Returns:
|
|
1314
|
+
Dictionary containing workflow information:
|
|
1315
|
+
{
|
|
1316
|
+
'guid': str, # Unique identifier
|
|
1317
|
+
'name': str, # Resource name
|
|
1318
|
+
'attributes': dict, # Resource attributes
|
|
1319
|
+
'status': str, # Resource status
|
|
1320
|
+
'updateTime': int # Last update timestamp
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
Raises:
|
|
1324
|
+
ValueError: When required parameters are missing or invalid:
|
|
1325
|
+
- Empty or None values for required fields
|
|
1326
|
+
- Invalid GUID format
|
|
1327
|
+
- Out-of-range values
|
|
1328
|
+
|
|
1329
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1330
|
+
- DefaultAzureCredential not configured
|
|
1331
|
+
- Insufficient permissions
|
|
1332
|
+
- Expired authentication token
|
|
1333
|
+
|
|
1334
|
+
HTTPError: When Purview API returns error:
|
|
1335
|
+
- 400: Bad request (invalid parameters)
|
|
1336
|
+
- 401: Unauthorized (authentication failed)
|
|
1337
|
+
- 403: Forbidden (insufficient permissions)
|
|
1338
|
+
- 404: Resource not found
|
|
1339
|
+
- 429: Rate limit exceeded
|
|
1340
|
+
- 500: Internal server error
|
|
1341
|
+
|
|
1342
|
+
NetworkError: When network connectivity fails
|
|
1343
|
+
|
|
1344
|
+
Example:
|
|
1345
|
+
# Basic usage
|
|
1346
|
+
client = Workflow()
|
|
1347
|
+
|
|
1348
|
+
result = client.workflowGetApprovalRequests(args=...)
|
|
1349
|
+
print(f"Result: {result}")
|
|
1350
|
+
|
|
1351
|
+
Use Cases:
|
|
1352
|
+
- Data Discovery: Find and explore data assets
|
|
1353
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1354
|
+
- Reporting: Generate catalog reports
|
|
1355
|
+
"""
|
|
1356
|
+
self.method = 'GET'
|
|
1357
|
+
self.endpoint = ENDPOINTS['workflow']['approval_requests']
|
|
1358
|
+
self.params = get_api_version_params('workflow')
|
|
1359
|
+
if args.get('--status'):
|
|
1360
|
+
self.params['status'] = args['--status']
|
|
1361
|
+
if args.get('--assignedTo'):
|
|
1362
|
+
self.params['assignedTo'] = args['--assignedTo']
|
|
1363
|
+
|
|
1364
|
+
@decorator
|
|
1365
|
+
def workflowGetApprovalRequest(self, args):
|
|
1366
|
+
"""
|
|
1367
|
+
Retrieve workflow information.
|
|
1368
|
+
|
|
1369
|
+
Retrieves detailed information about the specified workflow.
|
|
1370
|
+
Returns complete workflow metadata and properties.
|
|
1371
|
+
|
|
1372
|
+
Args:
|
|
1373
|
+
args: Dictionary of operation arguments.
|
|
1374
|
+
Contains operation-specific parameters.
|
|
1375
|
+
See method implementation for details.
|
|
1376
|
+
|
|
1377
|
+
Returns:
|
|
1378
|
+
Dictionary containing workflow information:
|
|
1379
|
+
{
|
|
1380
|
+
'guid': str, # Unique identifier
|
|
1381
|
+
'name': str, # Resource name
|
|
1382
|
+
'attributes': dict, # Resource attributes
|
|
1383
|
+
'status': str, # Resource status
|
|
1384
|
+
'updateTime': int # Last update timestamp
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
Raises:
|
|
1388
|
+
ValueError: When required parameters are missing or invalid:
|
|
1389
|
+
- Empty or None values for required fields
|
|
1390
|
+
- Invalid GUID format
|
|
1391
|
+
- Out-of-range values
|
|
1392
|
+
|
|
1393
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1394
|
+
- DefaultAzureCredential not configured
|
|
1395
|
+
- Insufficient permissions
|
|
1396
|
+
- Expired authentication token
|
|
1397
|
+
|
|
1398
|
+
HTTPError: When Purview API returns error:
|
|
1399
|
+
- 400: Bad request (invalid parameters)
|
|
1400
|
+
- 401: Unauthorized (authentication failed)
|
|
1401
|
+
- 403: Forbidden (insufficient permissions)
|
|
1402
|
+
- 404: Resource not found
|
|
1403
|
+
- 429: Rate limit exceeded
|
|
1404
|
+
- 500: Internal server error
|
|
1405
|
+
|
|
1406
|
+
NetworkError: When network connectivity fails
|
|
1407
|
+
|
|
1408
|
+
Example:
|
|
1409
|
+
# Basic usage
|
|
1410
|
+
client = Workflow()
|
|
1411
|
+
|
|
1412
|
+
result = client.workflowGetApprovalRequest(args=...)
|
|
1413
|
+
print(f"Result: {result}")
|
|
1414
|
+
|
|
1415
|
+
Use Cases:
|
|
1416
|
+
- Data Discovery: Find and explore data assets
|
|
1417
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1418
|
+
- Reporting: Generate catalog reports
|
|
1419
|
+
"""
|
|
1420
|
+
self.method = 'GET'
|
|
1421
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['approval_request'],
|
|
1422
|
+
requestId=args['--requestId'])
|
|
1423
|
+
self.params = get_api_version_params('workflow')
|
|
1424
|
+
|
|
1425
|
+
@decorator
|
|
1426
|
+
def workflowApproveRequest(self, args):
|
|
1427
|
+
"""
|
|
1428
|
+
Perform operation on resource.
|
|
1429
|
+
|
|
1430
|
+
|
|
1431
|
+
|
|
1432
|
+
Args:
|
|
1433
|
+
args: Dictionary of operation arguments.
|
|
1434
|
+
Contains operation-specific parameters.
|
|
1435
|
+
See method implementation for details.
|
|
1436
|
+
|
|
1437
|
+
Returns:
|
|
1438
|
+
[TODO: Specify return type and structure]
|
|
1439
|
+
[TODO: Document nested fields]
|
|
1440
|
+
|
|
1441
|
+
Raises:
|
|
1442
|
+
ValueError: When required parameters are missing or invalid:
|
|
1443
|
+
- Empty or None values for required fields
|
|
1444
|
+
- Invalid GUID format
|
|
1445
|
+
- Out-of-range values
|
|
1446
|
+
|
|
1447
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1448
|
+
- DefaultAzureCredential not configured
|
|
1449
|
+
- Insufficient permissions
|
|
1450
|
+
- Expired authentication token
|
|
1451
|
+
|
|
1452
|
+
HTTPError: When Purview API returns error:
|
|
1453
|
+
- 400: Bad request (invalid parameters)
|
|
1454
|
+
- 401: Unauthorized (authentication failed)
|
|
1455
|
+
- 403: Forbidden (insufficient permissions)
|
|
1456
|
+
- 404: Resource not found
|
|
1457
|
+
- 429: Rate limit exceeded
|
|
1458
|
+
- 500: Internal server error
|
|
1459
|
+
|
|
1460
|
+
NetworkError: When network connectivity fails
|
|
1461
|
+
|
|
1462
|
+
Example:
|
|
1463
|
+
# Basic usage
|
|
1464
|
+
client = Workflow()
|
|
1465
|
+
|
|
1466
|
+
result = client.workflowApproveRequest(args=...)
|
|
1467
|
+
print(f"Result: {result}")
|
|
1468
|
+
|
|
1469
|
+
Use Cases:
|
|
1470
|
+
- [TODO: Add specific use cases for this operation]
|
|
1471
|
+
- [TODO: Include business context]
|
|
1472
|
+
- [TODO: Explain when to use this method]
|
|
1473
|
+
"""
|
|
1474
|
+
self.method = 'POST'
|
|
1475
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['approve_request'],
|
|
1476
|
+
requestId=args['--requestId'])
|
|
1477
|
+
self.params = get_api_version_params('workflow')
|
|
1478
|
+
self.payload = {
|
|
1479
|
+
'decision': 'approved',
|
|
1480
|
+
'comments': args.get('--comments', '')
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
@decorator
|
|
1484
|
+
def workflowRejectRequest(self, args):
|
|
1485
|
+
"""
|
|
1486
|
+
Perform operation on resource.
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
Args:
|
|
1491
|
+
args: Dictionary of operation arguments.
|
|
1492
|
+
Contains operation-specific parameters.
|
|
1493
|
+
See method implementation for details.
|
|
1494
|
+
|
|
1495
|
+
Returns:
|
|
1496
|
+
[TODO: Specify return type and structure]
|
|
1497
|
+
[TODO: Document nested fields]
|
|
1498
|
+
|
|
1499
|
+
Raises:
|
|
1500
|
+
ValueError: When required parameters are missing or invalid:
|
|
1501
|
+
- Empty or None values for required fields
|
|
1502
|
+
- Invalid GUID format
|
|
1503
|
+
- Out-of-range values
|
|
1504
|
+
|
|
1505
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1506
|
+
- DefaultAzureCredential not configured
|
|
1507
|
+
- Insufficient permissions
|
|
1508
|
+
- Expired authentication token
|
|
1509
|
+
|
|
1510
|
+
HTTPError: When Purview API returns error:
|
|
1511
|
+
- 400: Bad request (invalid parameters)
|
|
1512
|
+
- 401: Unauthorized (authentication failed)
|
|
1513
|
+
- 403: Forbidden (insufficient permissions)
|
|
1514
|
+
- 404: Resource not found
|
|
1515
|
+
- 429: Rate limit exceeded
|
|
1516
|
+
- 500: Internal server error
|
|
1517
|
+
|
|
1518
|
+
NetworkError: When network connectivity fails
|
|
1519
|
+
|
|
1520
|
+
Example:
|
|
1521
|
+
# Basic usage
|
|
1522
|
+
client = Workflow()
|
|
1523
|
+
|
|
1524
|
+
result = client.workflowRejectRequest(args=...)
|
|
1525
|
+
print(f"Result: {result}")
|
|
1526
|
+
|
|
1527
|
+
Use Cases:
|
|
1528
|
+
- [TODO: Add specific use cases for this operation]
|
|
1529
|
+
- [TODO: Include business context]
|
|
1530
|
+
- [TODO: Explain when to use this method]
|
|
1531
|
+
"""
|
|
1532
|
+
self.method = 'POST'
|
|
1533
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['reject_request'],
|
|
1534
|
+
requestId=args['--requestId'])
|
|
1535
|
+
self.params = get_api_version_params('workflow')
|
|
1536
|
+
self.payload = {
|
|
1537
|
+
'decision': 'rejected',
|
|
1538
|
+
'comments': args.get('--comments', '')
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
# ========== Workflow Triggers ==========
|
|
1542
|
+
|
|
1543
|
+
@decorator
|
|
1544
|
+
def workflowListWorkflowTriggers(self, args):
|
|
1545
|
+
"""
|
|
1546
|
+
Retrieve workflow information.
|
|
1547
|
+
|
|
1548
|
+
Retrieves detailed information about the specified workflow.
|
|
1549
|
+
Returns complete workflow metadata and properties.
|
|
1550
|
+
|
|
1551
|
+
Args:
|
|
1552
|
+
args: Dictionary of operation arguments.
|
|
1553
|
+
Contains operation-specific parameters.
|
|
1554
|
+
See method implementation for details.
|
|
1555
|
+
|
|
1556
|
+
Returns:
|
|
1557
|
+
List of resource dictionaries, each containing:
|
|
1558
|
+
- guid (str): Unique identifier
|
|
1559
|
+
- name (str): Resource name
|
|
1560
|
+
- attributes (dict): Resource attributes
|
|
1561
|
+
- status (str): Resource status
|
|
1562
|
+
|
|
1563
|
+
Returns empty list if no resources found.
|
|
1564
|
+
|
|
1565
|
+
Raises:
|
|
1566
|
+
ValueError: When required parameters are missing or invalid:
|
|
1567
|
+
- Empty or None values for required fields
|
|
1568
|
+
- Invalid GUID format
|
|
1569
|
+
- Out-of-range values
|
|
1570
|
+
|
|
1571
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1572
|
+
- DefaultAzureCredential not configured
|
|
1573
|
+
- Insufficient permissions
|
|
1574
|
+
- Expired authentication token
|
|
1575
|
+
|
|
1576
|
+
HTTPError: When Purview API returns error:
|
|
1577
|
+
- 400: Bad request (invalid parameters)
|
|
1578
|
+
- 401: Unauthorized (authentication failed)
|
|
1579
|
+
- 403: Forbidden (insufficient permissions)
|
|
1580
|
+
- 404: Resource not found
|
|
1581
|
+
- 429: Rate limit exceeded
|
|
1582
|
+
- 500: Internal server error
|
|
1583
|
+
|
|
1584
|
+
NetworkError: When network connectivity fails
|
|
1585
|
+
|
|
1586
|
+
Example:
|
|
1587
|
+
# Basic usage
|
|
1588
|
+
client = Workflow()
|
|
1589
|
+
|
|
1590
|
+
result = client.workflowListWorkflowTriggers(args=...)
|
|
1591
|
+
print(f"Result: {result}")
|
|
1592
|
+
|
|
1593
|
+
Use Cases:
|
|
1594
|
+
- Data Discovery: Find and explore data assets
|
|
1595
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1596
|
+
- Reporting: Generate catalog reports
|
|
1597
|
+
"""
|
|
1598
|
+
self.method = 'GET'
|
|
1599
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_triggers'],
|
|
1600
|
+
workflowId=args['--workflowId'])
|
|
1601
|
+
self.params = get_api_version_params('workflow')
|
|
1602
|
+
|
|
1603
|
+
@decorator
|
|
1604
|
+
def workflowCreateWorkflowTrigger(self, args):
|
|
1605
|
+
"""
|
|
1606
|
+
Create a new workflow.
|
|
1607
|
+
|
|
1608
|
+
Creates a new workflow in Microsoft Purview Workflows. Automate governance tasks.
|
|
1609
|
+
Requires appropriate permissions and valid workflow definition.
|
|
1610
|
+
|
|
1611
|
+
Args:
|
|
1612
|
+
args: Dictionary of operation arguments.
|
|
1613
|
+
Contains operation-specific parameters.
|
|
1614
|
+
See method implementation for details.
|
|
1615
|
+
|
|
1616
|
+
Returns:
|
|
1617
|
+
Dictionary containing created workflow:
|
|
1618
|
+
{
|
|
1619
|
+
'guid': str, # Unique identifier
|
|
1620
|
+
'name': str, # Resource name
|
|
1621
|
+
'status': str, # Creation status
|
|
1622
|
+
'attributes': dict, # Resource attributes
|
|
1623
|
+
'createTime': int # Creation timestamp
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
Raises:
|
|
1627
|
+
ValueError: When required parameters are missing or invalid:
|
|
1628
|
+
- Empty or None values for required fields
|
|
1629
|
+
- Invalid GUID format
|
|
1630
|
+
- Out-of-range values
|
|
1631
|
+
|
|
1632
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1633
|
+
- DefaultAzureCredential not configured
|
|
1634
|
+
- Insufficient permissions
|
|
1635
|
+
- Expired authentication token
|
|
1636
|
+
|
|
1637
|
+
HTTPError: When Purview API returns error:
|
|
1638
|
+
- 400: Bad request (invalid parameters)
|
|
1639
|
+
- 401: Unauthorized (authentication failed)
|
|
1640
|
+
- 403: Forbidden (insufficient permissions)
|
|
1641
|
+
- 404: Resource not found
|
|
1642
|
+
- 409: Conflict (resource already exists)
|
|
1643
|
+
- 429: Rate limit exceeded
|
|
1644
|
+
- 500: Internal server error
|
|
1645
|
+
|
|
1646
|
+
NetworkError: When network connectivity fails
|
|
1647
|
+
|
|
1648
|
+
Example:
|
|
1649
|
+
# Basic usage
|
|
1650
|
+
client = Workflow()
|
|
1651
|
+
|
|
1652
|
+
result = client.workflowCreateWorkflowTrigger(args=...)
|
|
1653
|
+
print(f"Result: {result}")
|
|
1654
|
+
|
|
1655
|
+
# With detailed data
|
|
1656
|
+
data = {
|
|
1657
|
+
'name': 'My Resource',
|
|
1658
|
+
'description': 'Resource description',
|
|
1659
|
+
'attributes': {
|
|
1660
|
+
'key1': 'value1',
|
|
1661
|
+
'key2': 'value2'
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
result = client.workflowCreateWorkflowTrigger(data)
|
|
1666
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1667
|
+
|
|
1668
|
+
Use Cases:
|
|
1669
|
+
- Data Onboarding: Register new data sources in catalog
|
|
1670
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
1671
|
+
- Automation: Programmatically populate catalog
|
|
1672
|
+
"""
|
|
1673
|
+
self.method = 'POST'
|
|
1674
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['create_trigger'],
|
|
1675
|
+
workflowId=args['--workflowId'])
|
|
1676
|
+
self.params = get_api_version_params('workflow')
|
|
1677
|
+
self.payload = get_json(args, '--payloadFile')
|
|
1678
|
+
|
|
1679
|
+
@decorator
|
|
1680
|
+
def workflowDeleteWorkflowTrigger(self, args):
|
|
1681
|
+
"""
|
|
1682
|
+
Delete a workflow.
|
|
1683
|
+
|
|
1684
|
+
Permanently deletes the specified workflow.
|
|
1685
|
+
This operation cannot be undone. Use with caution.
|
|
1686
|
+
|
|
1687
|
+
Args:
|
|
1688
|
+
args: Dictionary of operation arguments.
|
|
1689
|
+
Contains operation-specific parameters.
|
|
1690
|
+
See method implementation for details.
|
|
1691
|
+
|
|
1692
|
+
Returns:
|
|
1693
|
+
Dictionary with deletion status:
|
|
1694
|
+
{
|
|
1695
|
+
'guid': str, # Deleted resource ID
|
|
1696
|
+
'status': str, # Deletion status
|
|
1697
|
+
'message': str # Confirmation message
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
Raises:
|
|
1701
|
+
ValueError: When required parameters are missing or invalid:
|
|
1702
|
+
- Empty or None values for required fields
|
|
1703
|
+
- Invalid GUID format
|
|
1704
|
+
- Out-of-range values
|
|
1705
|
+
|
|
1706
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1707
|
+
- DefaultAzureCredential not configured
|
|
1708
|
+
- Insufficient permissions
|
|
1709
|
+
- Expired authentication token
|
|
1710
|
+
|
|
1711
|
+
HTTPError: When Purview API returns error:
|
|
1712
|
+
- 400: Bad request (invalid parameters)
|
|
1713
|
+
- 401: Unauthorized (authentication failed)
|
|
1714
|
+
- 403: Forbidden (insufficient permissions)
|
|
1715
|
+
- 404: Resource not found
|
|
1716
|
+
- 429: Rate limit exceeded
|
|
1717
|
+
- 500: Internal server error
|
|
1718
|
+
|
|
1719
|
+
NetworkError: When network connectivity fails
|
|
1720
|
+
|
|
1721
|
+
Example:
|
|
1722
|
+
# Basic usage
|
|
1723
|
+
client = Workflow()
|
|
1724
|
+
|
|
1725
|
+
result = client.workflowDeleteWorkflowTrigger(args=...)
|
|
1726
|
+
print(f"Result: {result}")
|
|
1727
|
+
|
|
1728
|
+
Use Cases:
|
|
1729
|
+
- Data Cleanup: Remove obsolete or test data
|
|
1730
|
+
- Decommissioning: Delete resources no longer in use
|
|
1731
|
+
- Testing: Clean up test environments
|
|
1732
|
+
"""
|
|
1733
|
+
self.method = 'DELETE'
|
|
1734
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_trigger'],
|
|
1735
|
+
workflowId=args['--workflowId'],
|
|
1736
|
+
triggerId=args['--triggerId'])
|
|
1737
|
+
self.params = get_api_version_params('workflow')
|
|
1738
|
+
|
|
1739
|
+
# ========== Workflow Actions and Conditions ==========
|
|
1740
|
+
|
|
1741
|
+
@decorator
|
|
1742
|
+
def workflowGetWorkflowActions(self, args):
|
|
1743
|
+
"""
|
|
1744
|
+
Retrieve workflow information.
|
|
1745
|
+
|
|
1746
|
+
Retrieves detailed information about the specified workflow.
|
|
1747
|
+
Returns complete workflow metadata and properties.
|
|
1748
|
+
|
|
1749
|
+
Args:
|
|
1750
|
+
args: Dictionary of operation arguments.
|
|
1751
|
+
Contains operation-specific parameters.
|
|
1752
|
+
See method implementation for details.
|
|
1753
|
+
|
|
1754
|
+
Returns:
|
|
1755
|
+
Dictionary containing workflow information:
|
|
1756
|
+
{
|
|
1757
|
+
'guid': str, # Unique identifier
|
|
1758
|
+
'name': str, # Resource name
|
|
1759
|
+
'attributes': dict, # Resource attributes
|
|
1760
|
+
'status': str, # Resource status
|
|
1761
|
+
'updateTime': int # Last update timestamp
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
Raises:
|
|
1765
|
+
ValueError: When required parameters are missing or invalid:
|
|
1766
|
+
- Empty or None values for required fields
|
|
1767
|
+
- Invalid GUID format
|
|
1768
|
+
- Out-of-range values
|
|
1769
|
+
|
|
1770
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1771
|
+
- DefaultAzureCredential not configured
|
|
1772
|
+
- Insufficient permissions
|
|
1773
|
+
- Expired authentication token
|
|
1774
|
+
|
|
1775
|
+
HTTPError: When Purview API returns error:
|
|
1776
|
+
- 400: Bad request (invalid parameters)
|
|
1777
|
+
- 401: Unauthorized (authentication failed)
|
|
1778
|
+
- 403: Forbidden (insufficient permissions)
|
|
1779
|
+
- 404: Resource not found
|
|
1780
|
+
- 429: Rate limit exceeded
|
|
1781
|
+
- 500: Internal server error
|
|
1782
|
+
|
|
1783
|
+
NetworkError: When network connectivity fails
|
|
1784
|
+
|
|
1785
|
+
Example:
|
|
1786
|
+
# Basic usage
|
|
1787
|
+
client = Workflow()
|
|
1788
|
+
|
|
1789
|
+
result = client.workflowGetWorkflowActions(args=...)
|
|
1790
|
+
print(f"Result: {result}")
|
|
1791
|
+
|
|
1792
|
+
Use Cases:
|
|
1793
|
+
- Data Discovery: Find and explore data assets
|
|
1794
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1795
|
+
- Reporting: Generate catalog reports
|
|
1796
|
+
"""
|
|
1797
|
+
self.method = 'GET'
|
|
1798
|
+
self.endpoint = ENDPOINTS['workflow']['workflow_actions']
|
|
1799
|
+
self.params = get_api_version_params('workflow')
|
|
1800
|
+
|
|
1801
|
+
@decorator
|
|
1802
|
+
def workflowGetWorkflowConditions(self, args):
|
|
1803
|
+
"""
|
|
1804
|
+
Retrieve workflow information.
|
|
1805
|
+
|
|
1806
|
+
Retrieves detailed information about the specified workflow.
|
|
1807
|
+
Returns complete workflow metadata and properties.
|
|
1808
|
+
|
|
1809
|
+
Args:
|
|
1810
|
+
args: Dictionary of operation arguments.
|
|
1811
|
+
Contains operation-specific parameters.
|
|
1812
|
+
See method implementation for details.
|
|
1813
|
+
|
|
1814
|
+
Returns:
|
|
1815
|
+
Dictionary containing workflow information:
|
|
1816
|
+
{
|
|
1817
|
+
'guid': str, # Unique identifier
|
|
1818
|
+
'name': str, # Resource name
|
|
1819
|
+
'attributes': dict, # Resource attributes
|
|
1820
|
+
'status': str, # Resource status
|
|
1821
|
+
'updateTime': int # Last update timestamp
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
Raises:
|
|
1825
|
+
ValueError: When required parameters are missing or invalid:
|
|
1826
|
+
- Empty or None values for required fields
|
|
1827
|
+
- Invalid GUID format
|
|
1828
|
+
- Out-of-range values
|
|
1829
|
+
|
|
1830
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1831
|
+
- DefaultAzureCredential not configured
|
|
1832
|
+
- Insufficient permissions
|
|
1833
|
+
- Expired authentication token
|
|
1834
|
+
|
|
1835
|
+
HTTPError: When Purview API returns error:
|
|
1836
|
+
- 400: Bad request (invalid parameters)
|
|
1837
|
+
- 401: Unauthorized (authentication failed)
|
|
1838
|
+
- 403: Forbidden (insufficient permissions)
|
|
1839
|
+
- 404: Resource not found
|
|
1840
|
+
- 429: Rate limit exceeded
|
|
1841
|
+
- 500: Internal server error
|
|
1842
|
+
|
|
1843
|
+
NetworkError: When network connectivity fails
|
|
1844
|
+
|
|
1845
|
+
Example:
|
|
1846
|
+
# Basic usage
|
|
1847
|
+
client = Workflow()
|
|
1848
|
+
|
|
1849
|
+
result = client.workflowGetWorkflowConditions(args=...)
|
|
1850
|
+
print(f"Result: {result}")
|
|
1851
|
+
|
|
1852
|
+
Use Cases:
|
|
1853
|
+
- Data Discovery: Find and explore data assets
|
|
1854
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1855
|
+
- Reporting: Generate catalog reports
|
|
1856
|
+
"""
|
|
1857
|
+
self.method = 'GET'
|
|
1858
|
+
self.endpoint = ENDPOINTS['workflow']['workflow_conditions']
|
|
1859
|
+
self.params = get_api_version_params('workflow')
|
|
1860
|
+
|
|
1861
|
+
@decorator
|
|
1862
|
+
def workflowValidateWorkflow(self, args):
|
|
1863
|
+
"""
|
|
1864
|
+
Perform operation on resource.
|
|
1865
|
+
|
|
1866
|
+
|
|
1867
|
+
|
|
1868
|
+
Args:
|
|
1869
|
+
args: Dictionary of operation arguments.
|
|
1870
|
+
Contains operation-specific parameters.
|
|
1871
|
+
See method implementation for details.
|
|
1872
|
+
|
|
1873
|
+
Returns:
|
|
1874
|
+
[TODO: Specify return type and structure]
|
|
1875
|
+
[TODO: Document nested fields]
|
|
1876
|
+
|
|
1877
|
+
Raises:
|
|
1878
|
+
ValueError: When required parameters are missing or invalid:
|
|
1879
|
+
- Empty or None values for required fields
|
|
1880
|
+
- Invalid GUID format
|
|
1881
|
+
- Out-of-range values
|
|
1882
|
+
|
|
1883
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1884
|
+
- DefaultAzureCredential not configured
|
|
1885
|
+
- Insufficient permissions
|
|
1886
|
+
- Expired authentication token
|
|
1887
|
+
|
|
1888
|
+
HTTPError: When Purview API returns error:
|
|
1889
|
+
- 400: Bad request (invalid parameters)
|
|
1890
|
+
- 401: Unauthorized (authentication failed)
|
|
1891
|
+
- 403: Forbidden (insufficient permissions)
|
|
1892
|
+
- 404: Resource not found
|
|
1893
|
+
- 429: Rate limit exceeded
|
|
1894
|
+
- 500: Internal server error
|
|
1895
|
+
|
|
1896
|
+
NetworkError: When network connectivity fails
|
|
1897
|
+
|
|
1898
|
+
Example:
|
|
1899
|
+
# Basic usage
|
|
1900
|
+
client = Workflow()
|
|
1901
|
+
|
|
1902
|
+
result = client.workflowValidateWorkflow(args=...)
|
|
1903
|
+
print(f"Result: {result}")
|
|
1904
|
+
|
|
1905
|
+
Use Cases:
|
|
1906
|
+
- [TODO: Add specific use cases for this operation]
|
|
1907
|
+
- [TODO: Include business context]
|
|
1908
|
+
- [TODO: Explain when to use this method]
|
|
1909
|
+
"""
|
|
1910
|
+
self.method = 'POST'
|
|
1911
|
+
self.endpoint = ENDPOINTS['workflow']['validate_workflow']
|
|
1912
|
+
self.params = get_api_version_params('workflow')
|
|
1913
|
+
self.payload = get_json(args, '--payloadFile')
|
|
1914
|
+
|
|
1915
|
+
# ========== Workflow Monitoring and Metrics ==========
|
|
1916
|
+
|
|
1917
|
+
@decorator
|
|
1918
|
+
def workflowGetWorkflowMetrics(self, args):
|
|
1919
|
+
"""
|
|
1920
|
+
Retrieve workflow information.
|
|
1921
|
+
|
|
1922
|
+
Retrieves detailed information about the specified workflow.
|
|
1923
|
+
Returns complete workflow metadata and properties.
|
|
1924
|
+
|
|
1925
|
+
Args:
|
|
1926
|
+
args: Dictionary of operation arguments.
|
|
1927
|
+
Contains operation-specific parameters.
|
|
1928
|
+
See method implementation for details.
|
|
1929
|
+
|
|
1930
|
+
Returns:
|
|
1931
|
+
Dictionary containing workflow information:
|
|
1932
|
+
{
|
|
1933
|
+
'guid': str, # Unique identifier
|
|
1934
|
+
'name': str, # Resource name
|
|
1935
|
+
'attributes': dict, # Resource attributes
|
|
1936
|
+
'status': str, # Resource status
|
|
1937
|
+
'updateTime': int # Last update timestamp
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
Raises:
|
|
1941
|
+
ValueError: When required parameters are missing or invalid:
|
|
1942
|
+
- Empty or None values for required fields
|
|
1943
|
+
- Invalid GUID format
|
|
1944
|
+
- Out-of-range values
|
|
1945
|
+
|
|
1946
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1947
|
+
- DefaultAzureCredential not configured
|
|
1948
|
+
- Insufficient permissions
|
|
1949
|
+
- Expired authentication token
|
|
1950
|
+
|
|
1951
|
+
HTTPError: When Purview API returns error:
|
|
1952
|
+
- 400: Bad request (invalid parameters)
|
|
1953
|
+
- 401: Unauthorized (authentication failed)
|
|
1954
|
+
- 403: Forbidden (insufficient permissions)
|
|
1955
|
+
- 404: Resource not found
|
|
1956
|
+
- 429: Rate limit exceeded
|
|
1957
|
+
- 500: Internal server error
|
|
1958
|
+
|
|
1959
|
+
NetworkError: When network connectivity fails
|
|
1960
|
+
|
|
1961
|
+
Example:
|
|
1962
|
+
# Basic usage
|
|
1963
|
+
client = Workflow()
|
|
1964
|
+
|
|
1965
|
+
result = client.workflowGetWorkflowMetrics(args=...)
|
|
1966
|
+
print(f"Result: {result}")
|
|
1967
|
+
|
|
1968
|
+
Use Cases:
|
|
1969
|
+
- Data Discovery: Find and explore data assets
|
|
1970
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1971
|
+
- Reporting: Generate catalog reports
|
|
1972
|
+
"""
|
|
1973
|
+
self.method = 'GET'
|
|
1974
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_metrics'],
|
|
1975
|
+
workflowId=args['--workflowId'])
|
|
1976
|
+
self.params = get_api_version_params('workflow')
|
|
1977
|
+
if args.get('--timeRange'):
|
|
1978
|
+
self.params['timeRange'] = args['--timeRange']
|
|
1979
|
+
|
|
1980
|
+
@decorator
|
|
1981
|
+
def workflowGetWorkflowLogs(self, args):
|
|
1982
|
+
"""
|
|
1983
|
+
Retrieve workflow information.
|
|
1984
|
+
|
|
1985
|
+
Retrieves detailed information about the specified workflow.
|
|
1986
|
+
Returns complete workflow metadata and properties.
|
|
1987
|
+
|
|
1988
|
+
Args:
|
|
1989
|
+
args: Dictionary of operation arguments.
|
|
1990
|
+
Contains operation-specific parameters.
|
|
1991
|
+
See method implementation for details.
|
|
1992
|
+
|
|
1993
|
+
Returns:
|
|
1994
|
+
Dictionary containing workflow information:
|
|
1995
|
+
{
|
|
1996
|
+
'guid': str, # Unique identifier
|
|
1997
|
+
'name': str, # Resource name
|
|
1998
|
+
'attributes': dict, # Resource attributes
|
|
1999
|
+
'status': str, # Resource status
|
|
2000
|
+
'updateTime': int # Last update timestamp
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
Raises:
|
|
2004
|
+
ValueError: When required parameters are missing or invalid:
|
|
2005
|
+
- Empty or None values for required fields
|
|
2006
|
+
- Invalid GUID format
|
|
2007
|
+
- Out-of-range values
|
|
2008
|
+
|
|
2009
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2010
|
+
- DefaultAzureCredential not configured
|
|
2011
|
+
- Insufficient permissions
|
|
2012
|
+
- Expired authentication token
|
|
2013
|
+
|
|
2014
|
+
HTTPError: When Purview API returns error:
|
|
2015
|
+
- 400: Bad request (invalid parameters)
|
|
2016
|
+
- 401: Unauthorized (authentication failed)
|
|
2017
|
+
- 403: Forbidden (insufficient permissions)
|
|
2018
|
+
- 404: Resource not found
|
|
2019
|
+
- 429: Rate limit exceeded
|
|
2020
|
+
- 500: Internal server error
|
|
2021
|
+
|
|
2022
|
+
NetworkError: When network connectivity fails
|
|
2023
|
+
|
|
2024
|
+
Example:
|
|
2025
|
+
# Basic usage
|
|
2026
|
+
client = Workflow()
|
|
2027
|
+
|
|
2028
|
+
result = client.workflowGetWorkflowLogs(args=...)
|
|
2029
|
+
print(f"Result: {result}")
|
|
2030
|
+
|
|
2031
|
+
Use Cases:
|
|
2032
|
+
- Data Discovery: Find and explore data assets
|
|
2033
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2034
|
+
- Reporting: Generate catalog reports
|
|
2035
|
+
"""
|
|
2036
|
+
self.method = 'GET'
|
|
2037
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_logs'],
|
|
2038
|
+
workflowId=args['--workflowId'])
|
|
2039
|
+
self.params = get_api_version_params('workflow')
|
|
2040
|
+
if args.get('--executionId'):
|
|
2041
|
+
self.params['executionId'] = args['--executionId']
|
|
2042
|
+
|
|
2043
|
+
@decorator
|
|
2044
|
+
def workflowExportWorkflowLogs(self, args):
|
|
2045
|
+
"""
|
|
2046
|
+
Perform batch operation on resources.
|
|
2047
|
+
|
|
2048
|
+
Processes multiple resources in a single operation.
|
|
2049
|
+
More efficient than individual operations for bulk data.
|
|
2050
|
+
|
|
2051
|
+
Args:
|
|
2052
|
+
args: Dictionary of operation arguments.
|
|
2053
|
+
Contains operation-specific parameters.
|
|
2054
|
+
See method implementation for details.
|
|
2055
|
+
|
|
2056
|
+
Returns:
|
|
2057
|
+
Dictionary with batch operation results:
|
|
2058
|
+
{
|
|
2059
|
+
'succeeded': int, # Success count
|
|
2060
|
+
'failed': int, # Failure count
|
|
2061
|
+
'results': [...], # Per-item results
|
|
2062
|
+
'errors': [...] # Error details
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
Raises:
|
|
2066
|
+
ValueError: When required parameters are missing or invalid:
|
|
2067
|
+
- Empty or None values for required fields
|
|
2068
|
+
- Invalid GUID format
|
|
2069
|
+
- Out-of-range values
|
|
2070
|
+
|
|
2071
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2072
|
+
- DefaultAzureCredential not configured
|
|
2073
|
+
- Insufficient permissions
|
|
2074
|
+
- Expired authentication token
|
|
2075
|
+
|
|
2076
|
+
HTTPError: When Purview API returns error:
|
|
2077
|
+
- 400: Bad request (invalid parameters)
|
|
2078
|
+
- 401: Unauthorized (authentication failed)
|
|
2079
|
+
- 403: Forbidden (insufficient permissions)
|
|
2080
|
+
- 404: Resource not found
|
|
2081
|
+
- 429: Rate limit exceeded
|
|
2082
|
+
- 500: Internal server error
|
|
2083
|
+
|
|
2084
|
+
NetworkError: When network connectivity fails
|
|
2085
|
+
|
|
2086
|
+
Example:
|
|
2087
|
+
# Basic usage
|
|
2088
|
+
client = Workflow()
|
|
2089
|
+
|
|
2090
|
+
result = client.workflowExportWorkflowLogs(args=...)
|
|
2091
|
+
print(f"Result: {result}")
|
|
2092
|
+
|
|
2093
|
+
Use Cases:
|
|
2094
|
+
- Bulk Import: Load large volumes of metadata
|
|
2095
|
+
- Migration: Transfer catalog from other systems
|
|
2096
|
+
- Mass Updates: Apply changes to many resources
|
|
2097
|
+
"""
|
|
2098
|
+
self.method = 'POST'
|
|
2099
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['export_logs'],
|
|
2100
|
+
workflowId=args['--workflowId'])
|
|
2101
|
+
self.params = get_api_version_params('workflow')
|
|
2102
|
+
self.payload = {
|
|
2103
|
+
'format': args.get('--format', 'json'),
|
|
2104
|
+
'startTime': args.get('--startTime'),
|
|
2105
|
+
'endTime': args.get('--endTime')
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
# ========== Workflow Scheduling ==========
|
|
2109
|
+
|
|
2110
|
+
@decorator
|
|
2111
|
+
def workflowScheduleWorkflow(self, args):
|
|
2112
|
+
"""
|
|
2113
|
+
Perform operation on resource.
|
|
2114
|
+
|
|
2115
|
+
|
|
2116
|
+
|
|
2117
|
+
Args:
|
|
2118
|
+
args: Dictionary of operation arguments.
|
|
2119
|
+
Contains operation-specific parameters.
|
|
2120
|
+
See method implementation for details.
|
|
2121
|
+
|
|
2122
|
+
Returns:
|
|
2123
|
+
[TODO: Specify return type and structure]
|
|
2124
|
+
[TODO: Document nested fields]
|
|
2125
|
+
|
|
2126
|
+
Raises:
|
|
2127
|
+
ValueError: When required parameters are missing or invalid:
|
|
2128
|
+
- Empty or None values for required fields
|
|
2129
|
+
- Invalid GUID format
|
|
2130
|
+
- Out-of-range values
|
|
2131
|
+
|
|
2132
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2133
|
+
- DefaultAzureCredential not configured
|
|
2134
|
+
- Insufficient permissions
|
|
2135
|
+
- Expired authentication token
|
|
2136
|
+
|
|
2137
|
+
HTTPError: When Purview API returns error:
|
|
2138
|
+
- 400: Bad request (invalid parameters)
|
|
2139
|
+
- 401: Unauthorized (authentication failed)
|
|
2140
|
+
- 403: Forbidden (insufficient permissions)
|
|
2141
|
+
- 404: Resource not found
|
|
2142
|
+
- 429: Rate limit exceeded
|
|
2143
|
+
- 500: Internal server error
|
|
2144
|
+
|
|
2145
|
+
NetworkError: When network connectivity fails
|
|
2146
|
+
|
|
2147
|
+
Example:
|
|
2148
|
+
# Basic usage
|
|
2149
|
+
client = Workflow()
|
|
2150
|
+
|
|
2151
|
+
result = client.workflowScheduleWorkflow(args=...)
|
|
2152
|
+
print(f"Result: {result}")
|
|
2153
|
+
|
|
2154
|
+
Use Cases:
|
|
2155
|
+
- [TODO: Add specific use cases for this operation]
|
|
2156
|
+
- [TODO: Include business context]
|
|
2157
|
+
- [TODO: Explain when to use this method]
|
|
2158
|
+
"""
|
|
2159
|
+
self.method = 'POST'
|
|
2160
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['schedule_workflow'],
|
|
2161
|
+
workflowId=args['--workflowId'])
|
|
2162
|
+
self.params = get_api_version_params('workflow')
|
|
2163
|
+
self.payload = get_json(args, '--payloadFile')
|
|
2164
|
+
|
|
2165
|
+
@decorator
|
|
2166
|
+
def workflowGetWorkflowSchedules(self, args):
|
|
2167
|
+
"""
|
|
2168
|
+
Retrieve workflow information.
|
|
2169
|
+
|
|
2170
|
+
Retrieves detailed information about the specified workflow.
|
|
2171
|
+
Returns complete workflow metadata and properties.
|
|
2172
|
+
|
|
2173
|
+
Args:
|
|
2174
|
+
args: Dictionary of operation arguments.
|
|
2175
|
+
Contains operation-specific parameters.
|
|
2176
|
+
See method implementation for details.
|
|
2177
|
+
|
|
2178
|
+
Returns:
|
|
2179
|
+
Dictionary containing workflow information:
|
|
2180
|
+
{
|
|
2181
|
+
'guid': str, # Unique identifier
|
|
2182
|
+
'name': str, # Resource name
|
|
2183
|
+
'attributes': dict, # Resource attributes
|
|
2184
|
+
'status': str, # Resource status
|
|
2185
|
+
'updateTime': int # Last update timestamp
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
Raises:
|
|
2189
|
+
ValueError: When required parameters are missing or invalid:
|
|
2190
|
+
- Empty or None values for required fields
|
|
2191
|
+
- Invalid GUID format
|
|
2192
|
+
- Out-of-range values
|
|
2193
|
+
|
|
2194
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2195
|
+
- DefaultAzureCredential not configured
|
|
2196
|
+
- Insufficient permissions
|
|
2197
|
+
- Expired authentication token
|
|
2198
|
+
|
|
2199
|
+
HTTPError: When Purview API returns error:
|
|
2200
|
+
- 400: Bad request (invalid parameters)
|
|
2201
|
+
- 401: Unauthorized (authentication failed)
|
|
2202
|
+
- 403: Forbidden (insufficient permissions)
|
|
2203
|
+
- 404: Resource not found
|
|
2204
|
+
- 429: Rate limit exceeded
|
|
2205
|
+
- 500: Internal server error
|
|
2206
|
+
|
|
2207
|
+
NetworkError: When network connectivity fails
|
|
2208
|
+
|
|
2209
|
+
Example:
|
|
2210
|
+
# Basic usage
|
|
2211
|
+
client = Workflow()
|
|
2212
|
+
|
|
2213
|
+
result = client.workflowGetWorkflowSchedules(args=...)
|
|
2214
|
+
print(f"Result: {result}")
|
|
2215
|
+
|
|
2216
|
+
Use Cases:
|
|
2217
|
+
- Data Discovery: Find and explore data assets
|
|
2218
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2219
|
+
- Reporting: Generate catalog reports
|
|
2220
|
+
"""
|
|
2221
|
+
self.method = 'GET'
|
|
2222
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_schedules'],
|
|
2223
|
+
workflowId=args['--workflowId'])
|
|
2224
|
+
self.params = get_api_version_params('workflow')
|
|
2225
|
+
|
|
2226
|
+
@decorator
|
|
2227
|
+
def workflowDeleteWorkflowSchedule(self, args):
|
|
2228
|
+
"""
|
|
2229
|
+
Delete a workflow.
|
|
2230
|
+
|
|
2231
|
+
Permanently deletes the specified workflow.
|
|
2232
|
+
This operation cannot be undone. Use with caution.
|
|
2233
|
+
|
|
2234
|
+
Args:
|
|
2235
|
+
args: Dictionary of operation arguments.
|
|
2236
|
+
Contains operation-specific parameters.
|
|
2237
|
+
See method implementation for details.
|
|
2238
|
+
|
|
2239
|
+
Returns:
|
|
2240
|
+
Dictionary with deletion status:
|
|
2241
|
+
{
|
|
2242
|
+
'guid': str, # Deleted resource ID
|
|
2243
|
+
'status': str, # Deletion status
|
|
2244
|
+
'message': str # Confirmation message
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
Raises:
|
|
2248
|
+
ValueError: When required parameters are missing or invalid:
|
|
2249
|
+
- Empty or None values for required fields
|
|
2250
|
+
- Invalid GUID format
|
|
2251
|
+
- Out-of-range values
|
|
2252
|
+
|
|
2253
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2254
|
+
- DefaultAzureCredential not configured
|
|
2255
|
+
- Insufficient permissions
|
|
2256
|
+
- Expired authentication token
|
|
2257
|
+
|
|
2258
|
+
HTTPError: When Purview API returns error:
|
|
2259
|
+
- 400: Bad request (invalid parameters)
|
|
2260
|
+
- 401: Unauthorized (authentication failed)
|
|
2261
|
+
- 403: Forbidden (insufficient permissions)
|
|
2262
|
+
- 404: Resource not found
|
|
2263
|
+
- 429: Rate limit exceeded
|
|
2264
|
+
- 500: Internal server error
|
|
2265
|
+
|
|
2266
|
+
NetworkError: When network connectivity fails
|
|
2267
|
+
|
|
2268
|
+
Example:
|
|
2269
|
+
# Basic usage
|
|
2270
|
+
client = Workflow()
|
|
2271
|
+
|
|
2272
|
+
result = client.workflowDeleteWorkflowSchedule(args=...)
|
|
2273
|
+
print(f"Result: {result}")
|
|
2274
|
+
|
|
2275
|
+
Use Cases:
|
|
2276
|
+
- Data Cleanup: Remove obsolete or test data
|
|
2277
|
+
- Decommissioning: Delete resources no longer in use
|
|
2278
|
+
- Testing: Clean up test environments
|
|
2279
|
+
"""
|
|
2280
|
+
self.method = 'DELETE'
|
|
2281
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_schedule'],
|
|
2282
|
+
workflowId=args['--workflowId'],
|
|
2283
|
+
scheduleId=args['--scheduleId'])
|
|
2284
|
+
self.params = get_api_version_params('workflow')
|
|
2285
|
+
|
|
2286
|
+
# ========== Advanced Workflow Features ==========
|
|
2287
|
+
|
|
2288
|
+
@decorator
|
|
2289
|
+
def workflowCreateWorkflowVariable(self, args):
|
|
2290
|
+
"""
|
|
2291
|
+
Create a new workflow.
|
|
2292
|
+
|
|
2293
|
+
Creates a new workflow in Microsoft Purview Workflows. Automate governance tasks.
|
|
2294
|
+
Requires appropriate permissions and valid workflow definition.
|
|
2295
|
+
|
|
2296
|
+
Args:
|
|
2297
|
+
args: Dictionary of operation arguments.
|
|
2298
|
+
Contains operation-specific parameters.
|
|
2299
|
+
See method implementation for details.
|
|
2300
|
+
|
|
2301
|
+
Returns:
|
|
2302
|
+
Dictionary containing created workflow:
|
|
2303
|
+
{
|
|
2304
|
+
'guid': str, # Unique identifier
|
|
2305
|
+
'name': str, # Resource name
|
|
2306
|
+
'status': str, # Creation status
|
|
2307
|
+
'attributes': dict, # Resource attributes
|
|
2308
|
+
'createTime': int # Creation timestamp
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
Raises:
|
|
2312
|
+
ValueError: When required parameters are missing or invalid:
|
|
2313
|
+
- Empty or None values for required fields
|
|
2314
|
+
- Invalid GUID format
|
|
2315
|
+
- Out-of-range values
|
|
2316
|
+
|
|
2317
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2318
|
+
- DefaultAzureCredential not configured
|
|
2319
|
+
- Insufficient permissions
|
|
2320
|
+
- Expired authentication token
|
|
2321
|
+
|
|
2322
|
+
HTTPError: When Purview API returns error:
|
|
2323
|
+
- 400: Bad request (invalid parameters)
|
|
2324
|
+
- 401: Unauthorized (authentication failed)
|
|
2325
|
+
- 403: Forbidden (insufficient permissions)
|
|
2326
|
+
- 404: Resource not found
|
|
2327
|
+
- 409: Conflict (resource already exists)
|
|
2328
|
+
- 429: Rate limit exceeded
|
|
2329
|
+
- 500: Internal server error
|
|
2330
|
+
|
|
2331
|
+
NetworkError: When network connectivity fails
|
|
2332
|
+
|
|
2333
|
+
Example:
|
|
2334
|
+
# Basic usage
|
|
2335
|
+
client = Workflow()
|
|
2336
|
+
|
|
2337
|
+
result = client.workflowCreateWorkflowVariable(args=...)
|
|
2338
|
+
print(f"Result: {result}")
|
|
2339
|
+
|
|
2340
|
+
# With detailed data
|
|
2341
|
+
data = {
|
|
2342
|
+
'name': 'My Resource',
|
|
2343
|
+
'description': 'Resource description',
|
|
2344
|
+
'attributes': {
|
|
2345
|
+
'key1': 'value1',
|
|
2346
|
+
'key2': 'value2'
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
result = client.workflowCreateWorkflowVariable(data)
|
|
2351
|
+
print(f"Created/Updated: {result['guid']}")
|
|
2352
|
+
|
|
2353
|
+
Use Cases:
|
|
2354
|
+
- Data Onboarding: Register new data sources in catalog
|
|
2355
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
2356
|
+
- Automation: Programmatically populate catalog
|
|
2357
|
+
"""
|
|
2358
|
+
self.method = 'POST'
|
|
2359
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_variables'],
|
|
2360
|
+
workflowId=args['--workflowId'])
|
|
2361
|
+
self.params = get_api_version_params('workflow')
|
|
2362
|
+
self.payload = get_json(args, '--payloadFile')
|
|
2363
|
+
|
|
2364
|
+
@decorator
|
|
2365
|
+
def workflowGetWorkflowVariables(self, args):
|
|
2366
|
+
"""
|
|
2367
|
+
Retrieve workflow information.
|
|
2368
|
+
|
|
2369
|
+
Retrieves detailed information about the specified workflow.
|
|
2370
|
+
Returns complete workflow metadata and properties.
|
|
2371
|
+
|
|
2372
|
+
Args:
|
|
2373
|
+
args: Dictionary of operation arguments.
|
|
2374
|
+
Contains operation-specific parameters.
|
|
2375
|
+
See method implementation for details.
|
|
2376
|
+
|
|
2377
|
+
Returns:
|
|
2378
|
+
Dictionary containing workflow information:
|
|
2379
|
+
{
|
|
2380
|
+
'guid': str, # Unique identifier
|
|
2381
|
+
'name': str, # Resource name
|
|
2382
|
+
'attributes': dict, # Resource attributes
|
|
2383
|
+
'status': str, # Resource status
|
|
2384
|
+
'updateTime': int # Last update timestamp
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
Raises:
|
|
2388
|
+
ValueError: When required parameters are missing or invalid:
|
|
2389
|
+
- Empty or None values for required fields
|
|
2390
|
+
- Invalid GUID format
|
|
2391
|
+
- Out-of-range values
|
|
2392
|
+
|
|
2393
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2394
|
+
- DefaultAzureCredential not configured
|
|
2395
|
+
- Insufficient permissions
|
|
2396
|
+
- Expired authentication token
|
|
2397
|
+
|
|
2398
|
+
HTTPError: When Purview API returns error:
|
|
2399
|
+
- 400: Bad request (invalid parameters)
|
|
2400
|
+
- 401: Unauthorized (authentication failed)
|
|
2401
|
+
- 403: Forbidden (insufficient permissions)
|
|
2402
|
+
- 404: Resource not found
|
|
2403
|
+
- 429: Rate limit exceeded
|
|
2404
|
+
- 500: Internal server error
|
|
2405
|
+
|
|
2406
|
+
NetworkError: When network connectivity fails
|
|
2407
|
+
|
|
2408
|
+
Example:
|
|
2409
|
+
# Basic usage
|
|
2410
|
+
client = Workflow()
|
|
2411
|
+
|
|
2412
|
+
result = client.workflowGetWorkflowVariables(args=...)
|
|
2413
|
+
print(f"Result: {result}")
|
|
2414
|
+
|
|
2415
|
+
Use Cases:
|
|
2416
|
+
- Data Discovery: Find and explore data assets
|
|
2417
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2418
|
+
- Reporting: Generate catalog reports
|
|
2419
|
+
"""
|
|
2420
|
+
self.method = 'GET'
|
|
2421
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_variables'],
|
|
2422
|
+
workflowId=args['--workflowId'])
|
|
2423
|
+
self.params = get_api_version_params('workflow')
|
|
2424
|
+
|
|
2425
|
+
@decorator
|
|
2426
|
+
def workflowCreateWorkflowVersion(self, args):
|
|
2427
|
+
"""
|
|
2428
|
+
Create a new workflow.
|
|
2429
|
+
|
|
2430
|
+
Creates a new workflow in Microsoft Purview Workflows. Automate governance tasks.
|
|
2431
|
+
Requires appropriate permissions and valid workflow definition.
|
|
2432
|
+
|
|
2433
|
+
Args:
|
|
2434
|
+
args: Dictionary of operation arguments.
|
|
2435
|
+
Contains operation-specific parameters.
|
|
2436
|
+
See method implementation for details.
|
|
2437
|
+
|
|
2438
|
+
Returns:
|
|
2439
|
+
Dictionary containing created workflow:
|
|
2440
|
+
{
|
|
2441
|
+
'guid': str, # Unique identifier
|
|
2442
|
+
'name': str, # Resource name
|
|
2443
|
+
'status': str, # Creation status
|
|
2444
|
+
'attributes': dict, # Resource attributes
|
|
2445
|
+
'createTime': int # Creation timestamp
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
Raises:
|
|
2449
|
+
ValueError: When required parameters are missing or invalid:
|
|
2450
|
+
- Empty or None values for required fields
|
|
2451
|
+
- Invalid GUID format
|
|
2452
|
+
- Out-of-range values
|
|
2453
|
+
|
|
2454
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2455
|
+
- DefaultAzureCredential not configured
|
|
2456
|
+
- Insufficient permissions
|
|
2457
|
+
- Expired authentication token
|
|
2458
|
+
|
|
2459
|
+
HTTPError: When Purview API returns error:
|
|
2460
|
+
- 400: Bad request (invalid parameters)
|
|
2461
|
+
- 401: Unauthorized (authentication failed)
|
|
2462
|
+
- 403: Forbidden (insufficient permissions)
|
|
2463
|
+
- 404: Resource not found
|
|
2464
|
+
- 409: Conflict (resource already exists)
|
|
2465
|
+
- 429: Rate limit exceeded
|
|
2466
|
+
- 500: Internal server error
|
|
2467
|
+
|
|
2468
|
+
NetworkError: When network connectivity fails
|
|
2469
|
+
|
|
2470
|
+
Example:
|
|
2471
|
+
# Basic usage
|
|
2472
|
+
client = Workflow()
|
|
2473
|
+
|
|
2474
|
+
result = client.workflowCreateWorkflowVersion(args=...)
|
|
2475
|
+
print(f"Result: {result}")
|
|
2476
|
+
|
|
2477
|
+
# With detailed data
|
|
2478
|
+
data = {
|
|
2479
|
+
'name': 'My Resource',
|
|
2480
|
+
'description': 'Resource description',
|
|
2481
|
+
'attributes': {
|
|
2482
|
+
'key1': 'value1',
|
|
2483
|
+
'key2': 'value2'
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
result = client.workflowCreateWorkflowVersion(data)
|
|
2488
|
+
print(f"Created/Updated: {result['guid']}")
|
|
2489
|
+
|
|
2490
|
+
Use Cases:
|
|
2491
|
+
- Data Onboarding: Register new data sources in catalog
|
|
2492
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
2493
|
+
- Automation: Programmatically populate catalog
|
|
2494
|
+
"""
|
|
2495
|
+
self.method = 'POST'
|
|
2496
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_versions'],
|
|
2497
|
+
workflowId=args['--workflowId'])
|
|
2498
|
+
self.params = get_api_version_params('workflow')
|
|
2499
|
+
self.payload = get_json(args, '--payloadFile')
|
|
2500
|
+
|
|
2501
|
+
@decorator
|
|
2502
|
+
def workflowGetWorkflowVersions(self, args):
|
|
2503
|
+
"""
|
|
2504
|
+
Retrieve workflow information.
|
|
2505
|
+
|
|
2506
|
+
Retrieves detailed information about the specified workflow.
|
|
2507
|
+
Returns complete workflow metadata and properties.
|
|
2508
|
+
|
|
2509
|
+
Args:
|
|
2510
|
+
args: Dictionary of operation arguments.
|
|
2511
|
+
Contains operation-specific parameters.
|
|
2512
|
+
See method implementation for details.
|
|
2513
|
+
|
|
2514
|
+
Returns:
|
|
2515
|
+
Dictionary containing workflow information:
|
|
2516
|
+
{
|
|
2517
|
+
'guid': str, # Unique identifier
|
|
2518
|
+
'name': str, # Resource name
|
|
2519
|
+
'attributes': dict, # Resource attributes
|
|
2520
|
+
'status': str, # Resource status
|
|
2521
|
+
'updateTime': int # Last update timestamp
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
Raises:
|
|
2525
|
+
ValueError: When required parameters are missing or invalid:
|
|
2526
|
+
- Empty or None values for required fields
|
|
2527
|
+
- Invalid GUID format
|
|
2528
|
+
- Out-of-range values
|
|
2529
|
+
|
|
2530
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2531
|
+
- DefaultAzureCredential not configured
|
|
2532
|
+
- Insufficient permissions
|
|
2533
|
+
- Expired authentication token
|
|
2534
|
+
|
|
2535
|
+
HTTPError: When Purview API returns error:
|
|
2536
|
+
- 400: Bad request (invalid parameters)
|
|
2537
|
+
- 401: Unauthorized (authentication failed)
|
|
2538
|
+
- 403: Forbidden (insufficient permissions)
|
|
2539
|
+
- 404: Resource not found
|
|
2540
|
+
- 429: Rate limit exceeded
|
|
2541
|
+
- 500: Internal server error
|
|
2542
|
+
|
|
2543
|
+
NetworkError: When network connectivity fails
|
|
2544
|
+
|
|
2545
|
+
Example:
|
|
2546
|
+
# Basic usage
|
|
2547
|
+
client = Workflow()
|
|
2548
|
+
|
|
2549
|
+
result = client.workflowGetWorkflowVersions(args=...)
|
|
2550
|
+
print(f"Result: {result}")
|
|
2551
|
+
|
|
2552
|
+
Use Cases:
|
|
2553
|
+
- Data Discovery: Find and explore data assets
|
|
2554
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2555
|
+
- Reporting: Generate catalog reports
|
|
2556
|
+
"""
|
|
2557
|
+
self.method = 'GET'
|
|
2558
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['workflow_versions'],
|
|
2559
|
+
workflowId=args['--workflowId'])
|
|
2560
|
+
self.params = get_api_version_params('workflow')
|
|
2561
|
+
|
|
2562
|
+
# ========== Workflow Integration ==========
|
|
2563
|
+
|
|
2564
|
+
@decorator
|
|
2565
|
+
def workflowGetWorkflowIntegrations(self, args):
|
|
2566
|
+
"""
|
|
2567
|
+
Retrieve workflow information.
|
|
2568
|
+
|
|
2569
|
+
Retrieves detailed information about the specified workflow.
|
|
2570
|
+
Returns complete workflow metadata and properties.
|
|
2571
|
+
|
|
2572
|
+
Args:
|
|
2573
|
+
args: Dictionary of operation arguments.
|
|
2574
|
+
Contains operation-specific parameters.
|
|
2575
|
+
See method implementation for details.
|
|
2576
|
+
|
|
2577
|
+
Returns:
|
|
2578
|
+
Dictionary containing workflow information:
|
|
2579
|
+
{
|
|
2580
|
+
'guid': str, # Unique identifier
|
|
2581
|
+
'name': str, # Resource name
|
|
2582
|
+
'attributes': dict, # Resource attributes
|
|
2583
|
+
'status': str, # Resource status
|
|
2584
|
+
'updateTime': int # Last update timestamp
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
Raises:
|
|
2588
|
+
ValueError: When required parameters are missing or invalid:
|
|
2589
|
+
- Empty or None values for required fields
|
|
2590
|
+
- Invalid GUID format
|
|
2591
|
+
- Out-of-range values
|
|
2592
|
+
|
|
2593
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2594
|
+
- DefaultAzureCredential not configured
|
|
2595
|
+
- Insufficient permissions
|
|
2596
|
+
- Expired authentication token
|
|
2597
|
+
|
|
2598
|
+
HTTPError: When Purview API returns error:
|
|
2599
|
+
- 400: Bad request (invalid parameters)
|
|
2600
|
+
- 401: Unauthorized (authentication failed)
|
|
2601
|
+
- 403: Forbidden (insufficient permissions)
|
|
2602
|
+
- 404: Resource not found
|
|
2603
|
+
- 429: Rate limit exceeded
|
|
2604
|
+
- 500: Internal server error
|
|
2605
|
+
|
|
2606
|
+
NetworkError: When network connectivity fails
|
|
2607
|
+
|
|
2608
|
+
Example:
|
|
2609
|
+
# Basic usage
|
|
2610
|
+
client = Workflow()
|
|
2611
|
+
|
|
2612
|
+
result = client.workflowGetWorkflowIntegrations(args=...)
|
|
2613
|
+
print(f"Result: {result}")
|
|
2614
|
+
|
|
2615
|
+
Use Cases:
|
|
2616
|
+
- Data Discovery: Find and explore data assets
|
|
2617
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2618
|
+
- Reporting: Generate catalog reports
|
|
2619
|
+
"""
|
|
2620
|
+
self.method = 'GET'
|
|
2621
|
+
self.endpoint = ENDPOINTS['workflow']['workflow_integrations']
|
|
2622
|
+
self.params = get_api_version_params('workflow')
|
|
2623
|
+
|
|
2624
|
+
@decorator
|
|
2625
|
+
def workflowConfigureIntegration(self, args):
|
|
2626
|
+
"""
|
|
2627
|
+
Perform operation on resource.
|
|
2628
|
+
|
|
2629
|
+
|
|
2630
|
+
|
|
2631
|
+
Args:
|
|
2632
|
+
args: Dictionary of operation arguments.
|
|
2633
|
+
Contains operation-specific parameters.
|
|
2634
|
+
See method implementation for details.
|
|
2635
|
+
|
|
2636
|
+
Returns:
|
|
2637
|
+
[TODO: Specify return type and structure]
|
|
2638
|
+
[TODO: Document nested fields]
|
|
2639
|
+
|
|
2640
|
+
Raises:
|
|
2641
|
+
ValueError: When required parameters are missing or invalid:
|
|
2642
|
+
- Empty or None values for required fields
|
|
2643
|
+
- Invalid GUID format
|
|
2644
|
+
- Out-of-range values
|
|
2645
|
+
|
|
2646
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2647
|
+
- DefaultAzureCredential not configured
|
|
2648
|
+
- Insufficient permissions
|
|
2649
|
+
- Expired authentication token
|
|
2650
|
+
|
|
2651
|
+
HTTPError: When Purview API returns error:
|
|
2652
|
+
- 400: Bad request (invalid parameters)
|
|
2653
|
+
- 401: Unauthorized (authentication failed)
|
|
2654
|
+
- 403: Forbidden (insufficient permissions)
|
|
2655
|
+
- 404: Resource not found
|
|
2656
|
+
- 429: Rate limit exceeded
|
|
2657
|
+
- 500: Internal server error
|
|
2658
|
+
|
|
2659
|
+
NetworkError: When network connectivity fails
|
|
2660
|
+
|
|
2661
|
+
Example:
|
|
2662
|
+
# Basic usage
|
|
2663
|
+
client = Workflow()
|
|
2664
|
+
|
|
2665
|
+
result = client.workflowConfigureIntegration(args=...)
|
|
2666
|
+
print(f"Result: {result}")
|
|
2667
|
+
|
|
2668
|
+
Use Cases:
|
|
2669
|
+
- [TODO: Add specific use cases for this operation]
|
|
2670
|
+
- [TODO: Include business context]
|
|
2671
|
+
- [TODO: Explain when to use this method]
|
|
2672
|
+
"""
|
|
2673
|
+
self.method = 'POST'
|
|
2674
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['configure_integration'],
|
|
2675
|
+
workflowId=args['--workflowId'],
|
|
2676
|
+
integrationType=args['--integrationType'])
|
|
2677
|
+
self.params = get_api_version_params('workflow')
|
|
2678
|
+
self.payload = get_json(args, '--payloadFile')
|
|
2679
|
+
|
|
2680
|
+
@decorator
|
|
2681
|
+
def workflowTestIntegration(self, args):
|
|
2682
|
+
"""
|
|
2683
|
+
Perform operation on resource.
|
|
2684
|
+
|
|
2685
|
+
|
|
2686
|
+
|
|
2687
|
+
Args:
|
|
2688
|
+
args: Dictionary of operation arguments.
|
|
2689
|
+
Contains operation-specific parameters.
|
|
2690
|
+
See method implementation for details.
|
|
2691
|
+
|
|
2692
|
+
Returns:
|
|
2693
|
+
[TODO: Specify return type and structure]
|
|
2694
|
+
[TODO: Document nested fields]
|
|
2695
|
+
|
|
2696
|
+
Raises:
|
|
2697
|
+
ValueError: When required parameters are missing or invalid:
|
|
2698
|
+
- Empty or None values for required fields
|
|
2699
|
+
- Invalid GUID format
|
|
2700
|
+
- Out-of-range values
|
|
2701
|
+
|
|
2702
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2703
|
+
- DefaultAzureCredential not configured
|
|
2704
|
+
- Insufficient permissions
|
|
2705
|
+
- Expired authentication token
|
|
2706
|
+
|
|
2707
|
+
HTTPError: When Purview API returns error:
|
|
2708
|
+
- 400: Bad request (invalid parameters)
|
|
2709
|
+
- 401: Unauthorized (authentication failed)
|
|
2710
|
+
- 403: Forbidden (insufficient permissions)
|
|
2711
|
+
- 404: Resource not found
|
|
2712
|
+
- 429: Rate limit exceeded
|
|
2713
|
+
- 500: Internal server error
|
|
2714
|
+
|
|
2715
|
+
NetworkError: When network connectivity fails
|
|
2716
|
+
|
|
2717
|
+
Example:
|
|
2718
|
+
# Basic usage
|
|
2719
|
+
client = Workflow()
|
|
2720
|
+
|
|
2721
|
+
result = client.workflowTestIntegration(args=...)
|
|
2722
|
+
print(f"Result: {result}")
|
|
2723
|
+
|
|
2724
|
+
Use Cases:
|
|
2725
|
+
- [TODO: Add specific use cases for this operation]
|
|
2726
|
+
- [TODO: Include business context]
|
|
2727
|
+
- [TODO: Explain when to use this method]
|
|
2728
|
+
"""
|
|
2729
|
+
self.method = 'POST'
|
|
2730
|
+
self.endpoint = format_endpoint(ENDPOINTS['workflow']['test_integration'],
|
|
2731
|
+
workflowId=args['--workflowId'],
|
|
2732
|
+
integrationType=args['--integrationType'])
|
|
2733
|
+
self.params = get_api_version_params('workflow')
|
|
2734
|
+
self.payload = get_json(args, '--payloadFile') if args.get('--payloadFile') else {}
|