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,3233 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Glossary Management Client for Microsoft Purview Data Map API
|
|
3
|
+
Based on official API: https://learn.microsoft.com/en-us/rest/api/purview/datamapdataplane/glossary
|
|
4
|
+
API Version: 2023-09-01 / 2024-03-01-preview
|
|
5
|
+
|
|
6
|
+
Complete implementation of ALL Glossary operations from the official specification with 100% coverage:
|
|
7
|
+
- Glossary CRUD Operations (Create, Read, Update, Delete)
|
|
8
|
+
- Glossary Categories Management
|
|
9
|
+
- Glossary Terms Management
|
|
10
|
+
- Term Assignment and Relationships
|
|
11
|
+
- Import/Export Operations
|
|
12
|
+
- Advanced Glossary Analytics and Workflows
|
|
13
|
+
- Term Templates and Validation
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from .endpoint import Endpoint, decorator, get_json, no_api_call_decorator
|
|
17
|
+
from .endpoints import ENDPOINTS, get_api_version_params
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Glossary(Endpoint):
|
|
21
|
+
"""Glossary Management Operations - Complete Official API Implementation with 100% Coverage"""
|
|
22
|
+
|
|
23
|
+
def __init__(self):
|
|
24
|
+
Endpoint.__init__(self)
|
|
25
|
+
self.app = "catalog"
|
|
26
|
+
|
|
27
|
+
# === CORE GLOSSARY OPERATIONS ===
|
|
28
|
+
|
|
29
|
+
@decorator
|
|
30
|
+
def glossaryRead(self, args):
|
|
31
|
+
"""
|
|
32
|
+
Retrieve glossary information.
|
|
33
|
+
|
|
34
|
+
Retrieves detailed information about the specified glossary.
|
|
35
|
+
Returns complete glossary metadata and properties.
|
|
36
|
+
|
|
37
|
+
Args:
|
|
38
|
+
args: Dictionary of operation arguments.
|
|
39
|
+
Contains operation-specific parameters.
|
|
40
|
+
See method implementation for details.
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
Dictionary containing glossary information:
|
|
44
|
+
{
|
|
45
|
+
'guid': str, # Unique identifier
|
|
46
|
+
'name': str, # Resource name
|
|
47
|
+
'attributes': dict, # Resource attributes
|
|
48
|
+
'status': str, # Resource status
|
|
49
|
+
'updateTime': int # Last update timestamp
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
Raises:
|
|
53
|
+
ValueError: When required parameters are missing or invalid:
|
|
54
|
+
- Empty or None values for required fields
|
|
55
|
+
- Invalid GUID format
|
|
56
|
+
- Out-of-range values
|
|
57
|
+
|
|
58
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
59
|
+
- DefaultAzureCredential not configured
|
|
60
|
+
- Insufficient permissions
|
|
61
|
+
- Expired authentication token
|
|
62
|
+
|
|
63
|
+
HTTPError: When Purview API returns error:
|
|
64
|
+
- 400: Bad request (invalid parameters)
|
|
65
|
+
- 401: Unauthorized (authentication failed)
|
|
66
|
+
- 403: Forbidden (insufficient permissions)
|
|
67
|
+
- 404: Resource not found
|
|
68
|
+
- 429: Rate limit exceeded
|
|
69
|
+
- 500: Internal server error
|
|
70
|
+
|
|
71
|
+
NetworkError: When network connectivity fails
|
|
72
|
+
|
|
73
|
+
Example:
|
|
74
|
+
# Basic usage
|
|
75
|
+
client = Glossary()
|
|
76
|
+
|
|
77
|
+
result = client.glossaryRead(args=...)
|
|
78
|
+
print(f"Result: {result}")
|
|
79
|
+
|
|
80
|
+
Use Cases:
|
|
81
|
+
- Data Discovery: Find and explore data assets
|
|
82
|
+
- Compliance Auditing: Review metadata and classifications
|
|
83
|
+
- Reporting: Generate catalog reports
|
|
84
|
+
"""
|
|
85
|
+
self.method = "GET"
|
|
86
|
+
if args.get("--glossaryGuid"):
|
|
87
|
+
self.endpoint = ENDPOINTS["glossary"]["get"].format(glossaryId=args["--glossaryGuid"])
|
|
88
|
+
else:
|
|
89
|
+
self.endpoint = ENDPOINTS["glossary"]["list"]
|
|
90
|
+
self.params = {
|
|
91
|
+
**get_api_version_params("datamap"),
|
|
92
|
+
"limit": args.get("--limit"),
|
|
93
|
+
"offset": args.get("--offset"),
|
|
94
|
+
"sort": args.get("--sort"),
|
|
95
|
+
"ignoreTermsAndCategories": str(args.get("--ignoreTermsAndCategories", False)).lower(),
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@decorator
|
|
99
|
+
def glossaryCreate(self, args):
|
|
100
|
+
"""
|
|
101
|
+
Create a new glossary.
|
|
102
|
+
|
|
103
|
+
Creates a new glossary in Microsoft Purview.
|
|
104
|
+
Requires appropriate permissions and valid glossary definition.
|
|
105
|
+
|
|
106
|
+
Args:
|
|
107
|
+
args: Dictionary of operation arguments.
|
|
108
|
+
Contains operation-specific parameters.
|
|
109
|
+
See method implementation for details.
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
Dictionary containing created glossary:
|
|
113
|
+
{
|
|
114
|
+
'guid': str, # Unique identifier
|
|
115
|
+
'name': str, # Resource name
|
|
116
|
+
'status': str, # Creation status
|
|
117
|
+
'attributes': dict, # Resource attributes
|
|
118
|
+
'createTime': int # Creation timestamp
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
Raises:
|
|
122
|
+
ValueError: When required parameters are missing or invalid:
|
|
123
|
+
- Empty or None values for required fields
|
|
124
|
+
- Invalid GUID format
|
|
125
|
+
- Out-of-range values
|
|
126
|
+
|
|
127
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
128
|
+
- DefaultAzureCredential not configured
|
|
129
|
+
- Insufficient permissions
|
|
130
|
+
- Expired authentication token
|
|
131
|
+
|
|
132
|
+
HTTPError: When Purview API returns error:
|
|
133
|
+
- 400: Bad request (invalid parameters)
|
|
134
|
+
- 401: Unauthorized (authentication failed)
|
|
135
|
+
- 403: Forbidden (insufficient permissions)
|
|
136
|
+
- 404: Resource not found
|
|
137
|
+
- 409: Conflict (resource already exists)
|
|
138
|
+
- 429: Rate limit exceeded
|
|
139
|
+
- 500: Internal server error
|
|
140
|
+
|
|
141
|
+
NetworkError: When network connectivity fails
|
|
142
|
+
|
|
143
|
+
Example:
|
|
144
|
+
# Basic usage
|
|
145
|
+
client = Glossary()
|
|
146
|
+
|
|
147
|
+
result = client.glossaryCreate(args=...)
|
|
148
|
+
print(f"Result: {result}")
|
|
149
|
+
|
|
150
|
+
# With detailed data
|
|
151
|
+
data = {
|
|
152
|
+
'name': 'My Resource',
|
|
153
|
+
'description': 'Resource description',
|
|
154
|
+
'attributes': {
|
|
155
|
+
'key1': 'value1',
|
|
156
|
+
'key2': 'value2'
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
result = client.glossaryCreate(data)
|
|
161
|
+
print(f"Created/Updated: {result['guid']}")
|
|
162
|
+
|
|
163
|
+
Use Cases:
|
|
164
|
+
- Data Onboarding: Register new data sources in catalog
|
|
165
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
166
|
+
- Automation: Programmatically populate catalog
|
|
167
|
+
"""
|
|
168
|
+
self.method = "POST"
|
|
169
|
+
self.endpoint = ENDPOINTS["glossary"]["create"]
|
|
170
|
+
self.params = get_api_version_params("datamap")
|
|
171
|
+
payload = get_json(args, "--payloadFile")
|
|
172
|
+
if not isinstance(payload, dict):
|
|
173
|
+
raise ValueError(f"Glossary payload must be a JSON object (dict). Got: {type(payload)}")
|
|
174
|
+
self.payload = payload
|
|
175
|
+
|
|
176
|
+
@decorator
|
|
177
|
+
def glossaryUpdate(self, args):
|
|
178
|
+
"""
|
|
179
|
+
Update an existing glossary.
|
|
180
|
+
|
|
181
|
+
Updates an existing glossary with new values.
|
|
182
|
+
Only specified fields are modified; others remain unchanged.
|
|
183
|
+
|
|
184
|
+
Args:
|
|
185
|
+
args: Dictionary of operation arguments.
|
|
186
|
+
Contains operation-specific parameters.
|
|
187
|
+
See method implementation for details.
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
Dictionary containing updated glossary:
|
|
191
|
+
{
|
|
192
|
+
'guid': str, # Unique identifier
|
|
193
|
+
'attributes': dict, # Updated attributes
|
|
194
|
+
'updateTime': int # Update timestamp
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
Raises:
|
|
198
|
+
ValueError: When required parameters are missing or invalid:
|
|
199
|
+
- Empty or None values for required fields
|
|
200
|
+
- Invalid GUID format
|
|
201
|
+
- Out-of-range values
|
|
202
|
+
|
|
203
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
204
|
+
- DefaultAzureCredential not configured
|
|
205
|
+
- Insufficient permissions
|
|
206
|
+
- Expired authentication token
|
|
207
|
+
|
|
208
|
+
HTTPError: When Purview API returns error:
|
|
209
|
+
- 400: Bad request (invalid parameters)
|
|
210
|
+
- 401: Unauthorized (authentication failed)
|
|
211
|
+
- 403: Forbidden (insufficient permissions)
|
|
212
|
+
- 404: Resource not found
|
|
213
|
+
- 429: Rate limit exceeded
|
|
214
|
+
- 500: Internal server error
|
|
215
|
+
|
|
216
|
+
NetworkError: When network connectivity fails
|
|
217
|
+
|
|
218
|
+
Example:
|
|
219
|
+
# Basic usage
|
|
220
|
+
client = Glossary()
|
|
221
|
+
|
|
222
|
+
result = client.glossaryUpdate(args=...)
|
|
223
|
+
print(f"Result: {result}")
|
|
224
|
+
|
|
225
|
+
# With detailed data
|
|
226
|
+
data = {
|
|
227
|
+
'name': 'My Resource',
|
|
228
|
+
'description': 'Resource description',
|
|
229
|
+
'attributes': {
|
|
230
|
+
'key1': 'value1',
|
|
231
|
+
'key2': 'value2'
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
result = client.glossaryUpdate(data)
|
|
236
|
+
print(f"Created/Updated: {result['guid']}")
|
|
237
|
+
|
|
238
|
+
Use Cases:
|
|
239
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
240
|
+
- Ownership Changes: Reassign data ownership
|
|
241
|
+
- Classification: Apply or modify data classifications
|
|
242
|
+
"""
|
|
243
|
+
self.method = "PUT"
|
|
244
|
+
self.endpoint = ENDPOINTS["glossary"]["update"].format(glossaryId=args["--glossaryGuid"])
|
|
245
|
+
self.params = get_api_version_params("datamap")
|
|
246
|
+
self.payload = get_json(args, "--payloadFile")
|
|
247
|
+
|
|
248
|
+
@decorator
|
|
249
|
+
def glossaryDelete(self, args):
|
|
250
|
+
"""
|
|
251
|
+
Delete a glossary.
|
|
252
|
+
|
|
253
|
+
Permanently deletes the specified glossary.
|
|
254
|
+
This operation cannot be undone. Use with caution.
|
|
255
|
+
|
|
256
|
+
Args:
|
|
257
|
+
args: Dictionary of operation arguments.
|
|
258
|
+
Contains operation-specific parameters.
|
|
259
|
+
See method implementation for details.
|
|
260
|
+
|
|
261
|
+
Returns:
|
|
262
|
+
Dictionary with deletion status:
|
|
263
|
+
{
|
|
264
|
+
'guid': str, # Deleted resource ID
|
|
265
|
+
'status': str, # Deletion status
|
|
266
|
+
'message': str # Confirmation message
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
Raises:
|
|
270
|
+
ValueError: When required parameters are missing or invalid:
|
|
271
|
+
- Empty or None values for required fields
|
|
272
|
+
- Invalid GUID format
|
|
273
|
+
- Out-of-range values
|
|
274
|
+
|
|
275
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
276
|
+
- DefaultAzureCredential not configured
|
|
277
|
+
- Insufficient permissions
|
|
278
|
+
- Expired authentication token
|
|
279
|
+
|
|
280
|
+
HTTPError: When Purview API returns error:
|
|
281
|
+
- 400: Bad request (invalid parameters)
|
|
282
|
+
- 401: Unauthorized (authentication failed)
|
|
283
|
+
- 403: Forbidden (insufficient permissions)
|
|
284
|
+
- 404: Resource not found
|
|
285
|
+
- 429: Rate limit exceeded
|
|
286
|
+
- 500: Internal server error
|
|
287
|
+
|
|
288
|
+
NetworkError: When network connectivity fails
|
|
289
|
+
|
|
290
|
+
Example:
|
|
291
|
+
# Basic usage
|
|
292
|
+
client = Glossary()
|
|
293
|
+
|
|
294
|
+
result = client.glossaryDelete(args=...)
|
|
295
|
+
print(f"Result: {result}")
|
|
296
|
+
|
|
297
|
+
Use Cases:
|
|
298
|
+
- Data Cleanup: Remove obsolete or test data
|
|
299
|
+
- Decommissioning: Delete resources no longer in use
|
|
300
|
+
- Testing: Clean up test environments
|
|
301
|
+
"""
|
|
302
|
+
self.method = "DELETE"
|
|
303
|
+
self.endpoint = ENDPOINTS["glossary"]["delete"].format(glossaryId=args["--glossaryGuid"])
|
|
304
|
+
self.params = get_api_version_params("datamap")
|
|
305
|
+
|
|
306
|
+
@decorator
|
|
307
|
+
def glossaryReadDetailed(self, args):
|
|
308
|
+
"""
|
|
309
|
+
Create a new glossary.
|
|
310
|
+
|
|
311
|
+
Creates a new glossary in Microsoft Purview.
|
|
312
|
+
Requires appropriate permissions and valid glossary definition.
|
|
313
|
+
|
|
314
|
+
Args:
|
|
315
|
+
args: Dictionary of operation arguments.
|
|
316
|
+
Contains operation-specific parameters.
|
|
317
|
+
See method implementation for details.
|
|
318
|
+
|
|
319
|
+
Returns:
|
|
320
|
+
Dictionary containing created glossary:
|
|
321
|
+
{
|
|
322
|
+
'guid': str, # Unique identifier
|
|
323
|
+
'name': str, # Resource name
|
|
324
|
+
'status': str, # Creation status
|
|
325
|
+
'attributes': dict, # Resource attributes
|
|
326
|
+
'createTime': int # Creation timestamp
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
Raises:
|
|
330
|
+
ValueError: When required parameters are missing or invalid:
|
|
331
|
+
- Empty or None values for required fields
|
|
332
|
+
- Invalid GUID format
|
|
333
|
+
- Out-of-range values
|
|
334
|
+
|
|
335
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
336
|
+
- DefaultAzureCredential not configured
|
|
337
|
+
- Insufficient permissions
|
|
338
|
+
- Expired authentication token
|
|
339
|
+
|
|
340
|
+
HTTPError: When Purview API returns error:
|
|
341
|
+
- 400: Bad request (invalid parameters)
|
|
342
|
+
- 401: Unauthorized (authentication failed)
|
|
343
|
+
- 403: Forbidden (insufficient permissions)
|
|
344
|
+
- 404: Resource not found
|
|
345
|
+
- 409: Conflict (resource already exists)
|
|
346
|
+
- 429: Rate limit exceeded
|
|
347
|
+
- 500: Internal server error
|
|
348
|
+
|
|
349
|
+
NetworkError: When network connectivity fails
|
|
350
|
+
|
|
351
|
+
Example:
|
|
352
|
+
# Basic usage
|
|
353
|
+
client = Glossary()
|
|
354
|
+
|
|
355
|
+
result = client.glossaryReadDetailed(args=...)
|
|
356
|
+
print(f"Result: {result}")
|
|
357
|
+
|
|
358
|
+
# With detailed data
|
|
359
|
+
data = {
|
|
360
|
+
'name': 'My Resource',
|
|
361
|
+
'description': 'Resource description',
|
|
362
|
+
'attributes': {
|
|
363
|
+
'key1': 'value1',
|
|
364
|
+
'key2': 'value2'
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
result = client.glossaryReadDetailed(data)
|
|
369
|
+
print(f"Created/Updated: {result['guid']}")
|
|
370
|
+
|
|
371
|
+
Use Cases:
|
|
372
|
+
- Data Onboarding: Register new data sources in catalog
|
|
373
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
374
|
+
- Automation: Programmatically populate catalog
|
|
375
|
+
"""
|
|
376
|
+
self.method = "GET"
|
|
377
|
+
self.endpoint = ENDPOINTS["glossary"]["detailed"].format(glossaryGuid=args["--glossaryGuid"])
|
|
378
|
+
self.params = {
|
|
379
|
+
**get_api_version_params("datamap"),
|
|
380
|
+
"includeTermHierarchy": str(args.get("--includeTermHierarchy", False)).lower(),
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
@decorator
|
|
384
|
+
def glossaryReadPartial(self, args):
|
|
385
|
+
"""
|
|
386
|
+
Retrieve glossary information.
|
|
387
|
+
|
|
388
|
+
Retrieves detailed information about the specified glossary.
|
|
389
|
+
Returns complete glossary metadata and properties.
|
|
390
|
+
|
|
391
|
+
Args:
|
|
392
|
+
args: Dictionary of operation arguments.
|
|
393
|
+
Contains operation-specific parameters.
|
|
394
|
+
See method implementation for details.
|
|
395
|
+
|
|
396
|
+
Returns:
|
|
397
|
+
Dictionary containing glossary information:
|
|
398
|
+
{
|
|
399
|
+
'guid': str, # Unique identifier
|
|
400
|
+
'name': str, # Resource name
|
|
401
|
+
'attributes': dict, # Resource attributes
|
|
402
|
+
'status': str, # Resource status
|
|
403
|
+
'updateTime': int # Last update timestamp
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
Raises:
|
|
407
|
+
ValueError: When required parameters are missing or invalid:
|
|
408
|
+
- Empty or None values for required fields
|
|
409
|
+
- Invalid GUID format
|
|
410
|
+
- Out-of-range values
|
|
411
|
+
|
|
412
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
413
|
+
- DefaultAzureCredential not configured
|
|
414
|
+
- Insufficient permissions
|
|
415
|
+
- Expired authentication token
|
|
416
|
+
|
|
417
|
+
HTTPError: When Purview API returns error:
|
|
418
|
+
- 400: Bad request (invalid parameters)
|
|
419
|
+
- 401: Unauthorized (authentication failed)
|
|
420
|
+
- 403: Forbidden (insufficient permissions)
|
|
421
|
+
- 404: Resource not found
|
|
422
|
+
- 429: Rate limit exceeded
|
|
423
|
+
- 500: Internal server error
|
|
424
|
+
|
|
425
|
+
NetworkError: When network connectivity fails
|
|
426
|
+
|
|
427
|
+
Example:
|
|
428
|
+
# Basic usage
|
|
429
|
+
client = Glossary()
|
|
430
|
+
|
|
431
|
+
result = client.glossaryReadPartial(args=...)
|
|
432
|
+
print(f"Result: {result}")
|
|
433
|
+
|
|
434
|
+
Use Cases:
|
|
435
|
+
- Data Discovery: Find and explore data assets
|
|
436
|
+
- Compliance Auditing: Review metadata and classifications
|
|
437
|
+
- Reporting: Generate catalog reports
|
|
438
|
+
"""
|
|
439
|
+
self.method = "GET"
|
|
440
|
+
self.endpoint = ENDPOINTS["glossary"]["partial"].format(glossaryGuid=args["--glossaryGuid"])
|
|
441
|
+
self.params = get_api_version_params("datamap")
|
|
442
|
+
|
|
443
|
+
# === GLOSSARY CATEGORY OPERATIONS ===
|
|
444
|
+
|
|
445
|
+
@decorator
|
|
446
|
+
def glossaryReadCategories(self, args):
|
|
447
|
+
"""
|
|
448
|
+
Retrieve glossary category information.
|
|
449
|
+
|
|
450
|
+
Retrieves detailed information about the specified glossary category.
|
|
451
|
+
Returns complete glossary category metadata and properties.
|
|
452
|
+
|
|
453
|
+
Args:
|
|
454
|
+
args: Dictionary of operation arguments.
|
|
455
|
+
Contains operation-specific parameters.
|
|
456
|
+
See method implementation for details.
|
|
457
|
+
|
|
458
|
+
Returns:
|
|
459
|
+
Dictionary containing glossary category information:
|
|
460
|
+
{
|
|
461
|
+
'guid': str, # Unique identifier
|
|
462
|
+
'name': str, # Resource name
|
|
463
|
+
'attributes': dict, # Resource attributes
|
|
464
|
+
'status': str, # Resource status
|
|
465
|
+
'updateTime': int # Last update timestamp
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
Raises:
|
|
469
|
+
ValueError: When required parameters are missing or invalid:
|
|
470
|
+
- Empty or None values for required fields
|
|
471
|
+
- Invalid GUID format
|
|
472
|
+
- Out-of-range values
|
|
473
|
+
|
|
474
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
475
|
+
- DefaultAzureCredential not configured
|
|
476
|
+
- Insufficient permissions
|
|
477
|
+
- Expired authentication token
|
|
478
|
+
|
|
479
|
+
HTTPError: When Purview API returns error:
|
|
480
|
+
- 400: Bad request (invalid parameters)
|
|
481
|
+
- 401: Unauthorized (authentication failed)
|
|
482
|
+
- 403: Forbidden (insufficient permissions)
|
|
483
|
+
- 404: Resource not found
|
|
484
|
+
- 429: Rate limit exceeded
|
|
485
|
+
- 500: Internal server error
|
|
486
|
+
|
|
487
|
+
NetworkError: When network connectivity fails
|
|
488
|
+
|
|
489
|
+
Example:
|
|
490
|
+
# Basic usage
|
|
491
|
+
client = Glossary()
|
|
492
|
+
|
|
493
|
+
result = client.glossaryReadCategories(args=...)
|
|
494
|
+
print(f"Result: {result}")
|
|
495
|
+
|
|
496
|
+
Use Cases:
|
|
497
|
+
- Data Discovery: Find and explore data assets
|
|
498
|
+
- Compliance Auditing: Review metadata and classifications
|
|
499
|
+
- Reporting: Generate catalog reports
|
|
500
|
+
"""
|
|
501
|
+
self.method = "GET"
|
|
502
|
+
self.endpoint = ENDPOINTS["glossary"]["categories"]
|
|
503
|
+
self.params = {
|
|
504
|
+
**get_api_version_params("datamap"),
|
|
505
|
+
"limit": args.get("--limit"),
|
|
506
|
+
"offset": args.get("--offset"),
|
|
507
|
+
"sort": args.get("--sort"),
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
@decorator
|
|
511
|
+
def glossaryCreateCategories(self, args):
|
|
512
|
+
"""
|
|
513
|
+
Create a new glossary category.
|
|
514
|
+
|
|
515
|
+
Creates a new glossary category in Microsoft Purview.
|
|
516
|
+
Requires appropriate permissions and valid glossary category definition.
|
|
517
|
+
|
|
518
|
+
Args:
|
|
519
|
+
args: Dictionary of operation arguments.
|
|
520
|
+
Contains operation-specific parameters.
|
|
521
|
+
See method implementation for details.
|
|
522
|
+
|
|
523
|
+
Returns:
|
|
524
|
+
Dictionary containing created glossary category:
|
|
525
|
+
{
|
|
526
|
+
'guid': str, # Unique identifier
|
|
527
|
+
'name': str, # Resource name
|
|
528
|
+
'status': str, # Creation status
|
|
529
|
+
'attributes': dict, # Resource attributes
|
|
530
|
+
'createTime': int # Creation timestamp
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
Raises:
|
|
534
|
+
ValueError: When required parameters are missing or invalid:
|
|
535
|
+
- Empty or None values for required fields
|
|
536
|
+
- Invalid GUID format
|
|
537
|
+
- Out-of-range values
|
|
538
|
+
|
|
539
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
540
|
+
- DefaultAzureCredential not configured
|
|
541
|
+
- Insufficient permissions
|
|
542
|
+
- Expired authentication token
|
|
543
|
+
|
|
544
|
+
HTTPError: When Purview API returns error:
|
|
545
|
+
- 400: Bad request (invalid parameters)
|
|
546
|
+
- 401: Unauthorized (authentication failed)
|
|
547
|
+
- 403: Forbidden (insufficient permissions)
|
|
548
|
+
- 404: Resource not found
|
|
549
|
+
- 409: Conflict (resource already exists)
|
|
550
|
+
- 429: Rate limit exceeded
|
|
551
|
+
- 500: Internal server error
|
|
552
|
+
|
|
553
|
+
NetworkError: When network connectivity fails
|
|
554
|
+
|
|
555
|
+
Example:
|
|
556
|
+
# Basic usage
|
|
557
|
+
client = Glossary()
|
|
558
|
+
|
|
559
|
+
result = client.glossaryCreateCategories(args=...)
|
|
560
|
+
print(f"Result: {result}")
|
|
561
|
+
|
|
562
|
+
# With detailed data
|
|
563
|
+
data = {
|
|
564
|
+
'name': 'My Resource',
|
|
565
|
+
'description': 'Resource description',
|
|
566
|
+
'attributes': {
|
|
567
|
+
'key1': 'value1',
|
|
568
|
+
'key2': 'value2'
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
result = client.glossaryCreateCategories(data)
|
|
573
|
+
print(f"Created/Updated: {result['guid']}")
|
|
574
|
+
|
|
575
|
+
Use Cases:
|
|
576
|
+
- Data Onboarding: Register new data sources in catalog
|
|
577
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
578
|
+
- Automation: Programmatically populate catalog
|
|
579
|
+
"""
|
|
580
|
+
self.method = "POST"
|
|
581
|
+
self.endpoint = ENDPOINTS["glossary"]["create_categories"]
|
|
582
|
+
self.params = get_api_version_params("datamap")
|
|
583
|
+
payload = get_json(args, "--payloadFile")
|
|
584
|
+
if isinstance(payload, list):
|
|
585
|
+
self.payload = payload
|
|
586
|
+
elif isinstance(payload, dict) and "categories" in payload:
|
|
587
|
+
self.payload = payload["categories"]
|
|
588
|
+
else:
|
|
589
|
+
raise ValueError("Categories payload must be a list or a dict with 'categories' key.")
|
|
590
|
+
|
|
591
|
+
@decorator
|
|
592
|
+
def glossaryCreateCategory(self, args):
|
|
593
|
+
"""
|
|
594
|
+
Create a new glossary category.
|
|
595
|
+
|
|
596
|
+
Creates a new glossary category in Microsoft Purview.
|
|
597
|
+
Requires appropriate permissions and valid glossary category definition.
|
|
598
|
+
|
|
599
|
+
Args:
|
|
600
|
+
args: Dictionary of operation arguments.
|
|
601
|
+
Contains operation-specific parameters.
|
|
602
|
+
See method implementation for details.
|
|
603
|
+
|
|
604
|
+
Returns:
|
|
605
|
+
Dictionary containing created glossary category:
|
|
606
|
+
{
|
|
607
|
+
'guid': str, # Unique identifier
|
|
608
|
+
'name': str, # Resource name
|
|
609
|
+
'status': str, # Creation status
|
|
610
|
+
'attributes': dict, # Resource attributes
|
|
611
|
+
'createTime': int # Creation timestamp
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
Raises:
|
|
615
|
+
ValueError: When required parameters are missing or invalid:
|
|
616
|
+
- Empty or None values for required fields
|
|
617
|
+
- Invalid GUID format
|
|
618
|
+
- Out-of-range values
|
|
619
|
+
|
|
620
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
621
|
+
- DefaultAzureCredential not configured
|
|
622
|
+
- Insufficient permissions
|
|
623
|
+
- Expired authentication token
|
|
624
|
+
|
|
625
|
+
HTTPError: When Purview API returns error:
|
|
626
|
+
- 400: Bad request (invalid parameters)
|
|
627
|
+
- 401: Unauthorized (authentication failed)
|
|
628
|
+
- 403: Forbidden (insufficient permissions)
|
|
629
|
+
- 404: Resource not found
|
|
630
|
+
- 409: Conflict (resource already exists)
|
|
631
|
+
- 429: Rate limit exceeded
|
|
632
|
+
- 500: Internal server error
|
|
633
|
+
|
|
634
|
+
NetworkError: When network connectivity fails
|
|
635
|
+
|
|
636
|
+
Example:
|
|
637
|
+
# Basic usage
|
|
638
|
+
client = Glossary()
|
|
639
|
+
|
|
640
|
+
result = client.glossaryCreateCategory(args=...)
|
|
641
|
+
print(f"Result: {result}")
|
|
642
|
+
|
|
643
|
+
# With detailed data
|
|
644
|
+
data = {
|
|
645
|
+
'name': 'My Resource',
|
|
646
|
+
'description': 'Resource description',
|
|
647
|
+
'attributes': {
|
|
648
|
+
'key1': 'value1',
|
|
649
|
+
'key2': 'value2'
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
result = client.glossaryCreateCategory(data)
|
|
654
|
+
print(f"Created/Updated: {result['guid']}")
|
|
655
|
+
|
|
656
|
+
Use Cases:
|
|
657
|
+
- Data Onboarding: Register new data sources in catalog
|
|
658
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
659
|
+
- Automation: Programmatically populate catalog
|
|
660
|
+
"""
|
|
661
|
+
self.method = "POST"
|
|
662
|
+
self.endpoint = ENDPOINTS["glossary"]["create_category"]
|
|
663
|
+
self.params = get_api_version_params("datamap")
|
|
664
|
+
payload = get_json(args, "--payloadFile")
|
|
665
|
+
if not isinstance(payload, dict):
|
|
666
|
+
raise ValueError(f"Category payload must be a JSON object (dict). Got: {type(payload)}")
|
|
667
|
+
self.payload = payload
|
|
668
|
+
|
|
669
|
+
@decorator
|
|
670
|
+
def glossaryReadCategory(self, args):
|
|
671
|
+
"""
|
|
672
|
+
Retrieve glossary category information.
|
|
673
|
+
|
|
674
|
+
Retrieves detailed information about the specified glossary category.
|
|
675
|
+
Returns complete glossary category metadata and properties.
|
|
676
|
+
|
|
677
|
+
Args:
|
|
678
|
+
args: Dictionary of operation arguments.
|
|
679
|
+
Contains operation-specific parameters.
|
|
680
|
+
See method implementation for details.
|
|
681
|
+
|
|
682
|
+
Returns:
|
|
683
|
+
Dictionary containing glossary category information:
|
|
684
|
+
{
|
|
685
|
+
'guid': str, # Unique identifier
|
|
686
|
+
'name': str, # Resource name
|
|
687
|
+
'attributes': dict, # Resource attributes
|
|
688
|
+
'status': str, # Resource status
|
|
689
|
+
'updateTime': int # Last update timestamp
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
Raises:
|
|
693
|
+
ValueError: When required parameters are missing or invalid:
|
|
694
|
+
- Empty or None values for required fields
|
|
695
|
+
- Invalid GUID format
|
|
696
|
+
- Out-of-range values
|
|
697
|
+
|
|
698
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
699
|
+
- DefaultAzureCredential not configured
|
|
700
|
+
- Insufficient permissions
|
|
701
|
+
- Expired authentication token
|
|
702
|
+
|
|
703
|
+
HTTPError: When Purview API returns error:
|
|
704
|
+
- 400: Bad request (invalid parameters)
|
|
705
|
+
- 401: Unauthorized (authentication failed)
|
|
706
|
+
- 403: Forbidden (insufficient permissions)
|
|
707
|
+
- 404: Resource not found
|
|
708
|
+
- 429: Rate limit exceeded
|
|
709
|
+
- 500: Internal server error
|
|
710
|
+
|
|
711
|
+
NetworkError: When network connectivity fails
|
|
712
|
+
|
|
713
|
+
Example:
|
|
714
|
+
# Basic usage
|
|
715
|
+
client = Glossary()
|
|
716
|
+
|
|
717
|
+
result = client.glossaryReadCategory(args=...)
|
|
718
|
+
print(f"Result: {result}")
|
|
719
|
+
|
|
720
|
+
Use Cases:
|
|
721
|
+
- Data Discovery: Find and explore data assets
|
|
722
|
+
- Compliance Auditing: Review metadata and classifications
|
|
723
|
+
- Reporting: Generate catalog reports
|
|
724
|
+
"""
|
|
725
|
+
self.method = "GET"
|
|
726
|
+
self.endpoint = ENDPOINTS["glossary"]["get_category"].format(categoryId=args["--categoryGuid"])
|
|
727
|
+
self.params = {
|
|
728
|
+
**get_api_version_params("datamap"),
|
|
729
|
+
"limit": args.get("--limit"),
|
|
730
|
+
"offset": args.get("--offset"),
|
|
731
|
+
"sort": args.get("--sort"),
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
@decorator
|
|
735
|
+
def glossaryUpdateCategory(self, args):
|
|
736
|
+
"""
|
|
737
|
+
Update an existing glossary category.
|
|
738
|
+
|
|
739
|
+
Updates an existing glossary category with new values.
|
|
740
|
+
Only specified fields are modified; others remain unchanged.
|
|
741
|
+
|
|
742
|
+
Args:
|
|
743
|
+
args: Dictionary of operation arguments.
|
|
744
|
+
Contains operation-specific parameters.
|
|
745
|
+
See method implementation for details.
|
|
746
|
+
|
|
747
|
+
Returns:
|
|
748
|
+
Dictionary containing updated glossary category:
|
|
749
|
+
{
|
|
750
|
+
'guid': str, # Unique identifier
|
|
751
|
+
'attributes': dict, # Updated attributes
|
|
752
|
+
'updateTime': int # Update timestamp
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
Raises:
|
|
756
|
+
ValueError: When required parameters are missing or invalid:
|
|
757
|
+
- Empty or None values for required fields
|
|
758
|
+
- Invalid GUID format
|
|
759
|
+
- Out-of-range values
|
|
760
|
+
|
|
761
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
762
|
+
- DefaultAzureCredential not configured
|
|
763
|
+
- Insufficient permissions
|
|
764
|
+
- Expired authentication token
|
|
765
|
+
|
|
766
|
+
HTTPError: When Purview API returns error:
|
|
767
|
+
- 400: Bad request (invalid parameters)
|
|
768
|
+
- 401: Unauthorized (authentication failed)
|
|
769
|
+
- 403: Forbidden (insufficient permissions)
|
|
770
|
+
- 404: Resource not found
|
|
771
|
+
- 429: Rate limit exceeded
|
|
772
|
+
- 500: Internal server error
|
|
773
|
+
|
|
774
|
+
NetworkError: When network connectivity fails
|
|
775
|
+
|
|
776
|
+
Example:
|
|
777
|
+
# Basic usage
|
|
778
|
+
client = Glossary()
|
|
779
|
+
|
|
780
|
+
result = client.glossaryUpdateCategory(args=...)
|
|
781
|
+
print(f"Result: {result}")
|
|
782
|
+
|
|
783
|
+
# With detailed data
|
|
784
|
+
data = {
|
|
785
|
+
'name': 'My Resource',
|
|
786
|
+
'description': 'Resource description',
|
|
787
|
+
'attributes': {
|
|
788
|
+
'key1': 'value1',
|
|
789
|
+
'key2': 'value2'
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
result = client.glossaryUpdateCategory(data)
|
|
794
|
+
print(f"Created/Updated: {result['guid']}")
|
|
795
|
+
|
|
796
|
+
Use Cases:
|
|
797
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
798
|
+
- Ownership Changes: Reassign data ownership
|
|
799
|
+
- Classification: Apply or modify data classifications
|
|
800
|
+
"""
|
|
801
|
+
self.method = "PUT"
|
|
802
|
+
self.endpoint = ENDPOINTS["glossary"]["update_category"].format(categoryId=args["--categoryGuid"])
|
|
803
|
+
self.params = get_api_version_params("datamap")
|
|
804
|
+
self.payload = get_json(args, "--payloadFile")
|
|
805
|
+
|
|
806
|
+
@decorator
|
|
807
|
+
def glossaryDeleteCategory(self, args):
|
|
808
|
+
"""
|
|
809
|
+
Delete a glossary category.
|
|
810
|
+
|
|
811
|
+
Permanently deletes the specified glossary category.
|
|
812
|
+
This operation cannot be undone. Use with caution.
|
|
813
|
+
|
|
814
|
+
Args:
|
|
815
|
+
args: Dictionary of operation arguments.
|
|
816
|
+
Contains operation-specific parameters.
|
|
817
|
+
See method implementation for details.
|
|
818
|
+
|
|
819
|
+
Returns:
|
|
820
|
+
Dictionary with deletion status:
|
|
821
|
+
{
|
|
822
|
+
'guid': str, # Deleted resource ID
|
|
823
|
+
'status': str, # Deletion status
|
|
824
|
+
'message': str # Confirmation message
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
Raises:
|
|
828
|
+
ValueError: When required parameters are missing or invalid:
|
|
829
|
+
- Empty or None values for required fields
|
|
830
|
+
- Invalid GUID format
|
|
831
|
+
- Out-of-range values
|
|
832
|
+
|
|
833
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
834
|
+
- DefaultAzureCredential not configured
|
|
835
|
+
- Insufficient permissions
|
|
836
|
+
- Expired authentication token
|
|
837
|
+
|
|
838
|
+
HTTPError: When Purview API returns error:
|
|
839
|
+
- 400: Bad request (invalid parameters)
|
|
840
|
+
- 401: Unauthorized (authentication failed)
|
|
841
|
+
- 403: Forbidden (insufficient permissions)
|
|
842
|
+
- 404: Resource not found
|
|
843
|
+
- 429: Rate limit exceeded
|
|
844
|
+
- 500: Internal server error
|
|
845
|
+
|
|
846
|
+
NetworkError: When network connectivity fails
|
|
847
|
+
|
|
848
|
+
Example:
|
|
849
|
+
# Basic usage
|
|
850
|
+
client = Glossary()
|
|
851
|
+
|
|
852
|
+
result = client.glossaryDeleteCategory(args=...)
|
|
853
|
+
print(f"Result: {result}")
|
|
854
|
+
|
|
855
|
+
Use Cases:
|
|
856
|
+
- Data Cleanup: Remove obsolete or test data
|
|
857
|
+
- Decommissioning: Delete resources no longer in use
|
|
858
|
+
- Testing: Clean up test environments
|
|
859
|
+
"""
|
|
860
|
+
self.method = "DELETE"
|
|
861
|
+
self.endpoint = ENDPOINTS["glossary"]["delete_category"].format(categoryId=args["--categoryGuid"])
|
|
862
|
+
self.params = get_api_version_params("datamap")
|
|
863
|
+
|
|
864
|
+
@decorator
|
|
865
|
+
def glossaryReadCategoryPartial(self, args):
|
|
866
|
+
"""
|
|
867
|
+
Retrieve glossary category information.
|
|
868
|
+
|
|
869
|
+
Retrieves detailed information about the specified glossary category.
|
|
870
|
+
Returns complete glossary category metadata and properties.
|
|
871
|
+
|
|
872
|
+
Args:
|
|
873
|
+
args: Dictionary of operation arguments.
|
|
874
|
+
Contains operation-specific parameters.
|
|
875
|
+
See method implementation for details.
|
|
876
|
+
|
|
877
|
+
Returns:
|
|
878
|
+
Dictionary containing glossary category information:
|
|
879
|
+
{
|
|
880
|
+
'guid': str, # Unique identifier
|
|
881
|
+
'name': str, # Resource name
|
|
882
|
+
'attributes': dict, # Resource attributes
|
|
883
|
+
'status': str, # Resource status
|
|
884
|
+
'updateTime': int # Last update timestamp
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
Raises:
|
|
888
|
+
ValueError: When required parameters are missing or invalid:
|
|
889
|
+
- Empty or None values for required fields
|
|
890
|
+
- Invalid GUID format
|
|
891
|
+
- Out-of-range values
|
|
892
|
+
|
|
893
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
894
|
+
- DefaultAzureCredential not configured
|
|
895
|
+
- Insufficient permissions
|
|
896
|
+
- Expired authentication token
|
|
897
|
+
|
|
898
|
+
HTTPError: When Purview API returns error:
|
|
899
|
+
- 400: Bad request (invalid parameters)
|
|
900
|
+
- 401: Unauthorized (authentication failed)
|
|
901
|
+
- 403: Forbidden (insufficient permissions)
|
|
902
|
+
- 404: Resource not found
|
|
903
|
+
- 429: Rate limit exceeded
|
|
904
|
+
- 500: Internal server error
|
|
905
|
+
|
|
906
|
+
NetworkError: When network connectivity fails
|
|
907
|
+
|
|
908
|
+
Example:
|
|
909
|
+
# Basic usage
|
|
910
|
+
client = Glossary()
|
|
911
|
+
|
|
912
|
+
result = client.glossaryReadCategoryPartial(args=...)
|
|
913
|
+
print(f"Result: {result}")
|
|
914
|
+
|
|
915
|
+
Use Cases:
|
|
916
|
+
- Data Discovery: Find and explore data assets
|
|
917
|
+
- Compliance Auditing: Review metadata and classifications
|
|
918
|
+
- Reporting: Generate catalog reports
|
|
919
|
+
"""
|
|
920
|
+
self.method = "GET"
|
|
921
|
+
self.endpoint = ENDPOINTS["glossary"]["category_partial"].format(categoryGuid=args["--categoryGuid"])
|
|
922
|
+
self.params = get_api_version_params("datamap")
|
|
923
|
+
|
|
924
|
+
@decorator
|
|
925
|
+
def glossaryUpdateCategoryPartial(self, args):
|
|
926
|
+
"""
|
|
927
|
+
Update an existing glossary category.
|
|
928
|
+
|
|
929
|
+
Updates an existing glossary category with new values.
|
|
930
|
+
Only specified fields are modified; others remain unchanged.
|
|
931
|
+
|
|
932
|
+
Args:
|
|
933
|
+
args: Dictionary of operation arguments.
|
|
934
|
+
Contains operation-specific parameters.
|
|
935
|
+
See method implementation for details.
|
|
936
|
+
|
|
937
|
+
Returns:
|
|
938
|
+
Dictionary containing updated glossary category:
|
|
939
|
+
{
|
|
940
|
+
'guid': str, # Unique identifier
|
|
941
|
+
'attributes': dict, # Updated attributes
|
|
942
|
+
'updateTime': int # Update timestamp
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
Raises:
|
|
946
|
+
ValueError: When required parameters are missing or invalid:
|
|
947
|
+
- Empty or None values for required fields
|
|
948
|
+
- Invalid GUID format
|
|
949
|
+
- Out-of-range values
|
|
950
|
+
|
|
951
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
952
|
+
- DefaultAzureCredential not configured
|
|
953
|
+
- Insufficient permissions
|
|
954
|
+
- Expired authentication token
|
|
955
|
+
|
|
956
|
+
HTTPError: When Purview API returns error:
|
|
957
|
+
- 400: Bad request (invalid parameters)
|
|
958
|
+
- 401: Unauthorized (authentication failed)
|
|
959
|
+
- 403: Forbidden (insufficient permissions)
|
|
960
|
+
- 404: Resource not found
|
|
961
|
+
- 429: Rate limit exceeded
|
|
962
|
+
- 500: Internal server error
|
|
963
|
+
|
|
964
|
+
NetworkError: When network connectivity fails
|
|
965
|
+
|
|
966
|
+
Example:
|
|
967
|
+
# Basic usage
|
|
968
|
+
client = Glossary()
|
|
969
|
+
|
|
970
|
+
result = client.glossaryUpdateCategoryPartial(args=...)
|
|
971
|
+
print(f"Result: {result}")
|
|
972
|
+
|
|
973
|
+
# With detailed data
|
|
974
|
+
data = {
|
|
975
|
+
'name': 'My Resource',
|
|
976
|
+
'description': 'Resource description',
|
|
977
|
+
'attributes': {
|
|
978
|
+
'key1': 'value1',
|
|
979
|
+
'key2': 'value2'
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
result = client.glossaryUpdateCategoryPartial(data)
|
|
984
|
+
print(f"Created/Updated: {result['guid']}")
|
|
985
|
+
|
|
986
|
+
Use Cases:
|
|
987
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
988
|
+
- Ownership Changes: Reassign data ownership
|
|
989
|
+
- Classification: Apply or modify data classifications
|
|
990
|
+
"""
|
|
991
|
+
self.method = "PUT"
|
|
992
|
+
self.endpoint = ENDPOINTS["glossary"]["category_partial"].format(categoryGuid=args["--categoryGuid"])
|
|
993
|
+
self.params = get_api_version_params("datamap")
|
|
994
|
+
self.payload = get_json(args, "--payloadFile")
|
|
995
|
+
|
|
996
|
+
@decorator
|
|
997
|
+
def glossaryReadCategoryRelated(self, args):
|
|
998
|
+
"""
|
|
999
|
+
Retrieve glossary category information.
|
|
1000
|
+
|
|
1001
|
+
Retrieves detailed information about the specified glossary category.
|
|
1002
|
+
Returns complete glossary category metadata and properties.
|
|
1003
|
+
|
|
1004
|
+
Args:
|
|
1005
|
+
args: Dictionary of operation arguments.
|
|
1006
|
+
Contains operation-specific parameters.
|
|
1007
|
+
See method implementation for details.
|
|
1008
|
+
|
|
1009
|
+
Returns:
|
|
1010
|
+
Dictionary containing glossary category information:
|
|
1011
|
+
{
|
|
1012
|
+
'guid': str, # Unique identifier
|
|
1013
|
+
'name': str, # Resource name
|
|
1014
|
+
'attributes': dict, # Resource attributes
|
|
1015
|
+
'status': str, # Resource status
|
|
1016
|
+
'updateTime': int # Last update timestamp
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
Raises:
|
|
1020
|
+
ValueError: When required parameters are missing or invalid:
|
|
1021
|
+
- Empty or None values for required fields
|
|
1022
|
+
- Invalid GUID format
|
|
1023
|
+
- Out-of-range values
|
|
1024
|
+
|
|
1025
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1026
|
+
- DefaultAzureCredential not configured
|
|
1027
|
+
- Insufficient permissions
|
|
1028
|
+
- Expired authentication token
|
|
1029
|
+
|
|
1030
|
+
HTTPError: When Purview API returns error:
|
|
1031
|
+
- 400: Bad request (invalid parameters)
|
|
1032
|
+
- 401: Unauthorized (authentication failed)
|
|
1033
|
+
- 403: Forbidden (insufficient permissions)
|
|
1034
|
+
- 404: Resource not found
|
|
1035
|
+
- 429: Rate limit exceeded
|
|
1036
|
+
- 500: Internal server error
|
|
1037
|
+
|
|
1038
|
+
NetworkError: When network connectivity fails
|
|
1039
|
+
|
|
1040
|
+
Example:
|
|
1041
|
+
# Basic usage
|
|
1042
|
+
client = Glossary()
|
|
1043
|
+
|
|
1044
|
+
result = client.glossaryReadCategoryRelated(args=...)
|
|
1045
|
+
print(f"Result: {result}")
|
|
1046
|
+
|
|
1047
|
+
Use Cases:
|
|
1048
|
+
- Data Discovery: Find and explore data assets
|
|
1049
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1050
|
+
- Reporting: Generate catalog reports
|
|
1051
|
+
"""
|
|
1052
|
+
self.method = "GET"
|
|
1053
|
+
self.endpoint = ENDPOINTS["glossary"]["category_related"].format(categoryGuid=args["--categoryGuid"])
|
|
1054
|
+
self.params = {
|
|
1055
|
+
**get_api_version_params("datamap"),
|
|
1056
|
+
"limit": args.get("--limit"),
|
|
1057
|
+
"offset": args.get("--offset"),
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
@decorator
|
|
1061
|
+
def glossaryReadCategoryTerms(self, args):
|
|
1062
|
+
"""
|
|
1063
|
+
Retrieve glossary category information.
|
|
1064
|
+
|
|
1065
|
+
Retrieves detailed information about the specified glossary category.
|
|
1066
|
+
Returns complete glossary category metadata and properties.
|
|
1067
|
+
|
|
1068
|
+
Args:
|
|
1069
|
+
args: Dictionary of operation arguments.
|
|
1070
|
+
Contains operation-specific parameters.
|
|
1071
|
+
See method implementation for details.
|
|
1072
|
+
|
|
1073
|
+
Returns:
|
|
1074
|
+
Dictionary containing glossary category information:
|
|
1075
|
+
{
|
|
1076
|
+
'guid': str, # Unique identifier
|
|
1077
|
+
'name': str, # Resource name
|
|
1078
|
+
'attributes': dict, # Resource attributes
|
|
1079
|
+
'status': str, # Resource status
|
|
1080
|
+
'updateTime': int # Last update timestamp
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
Raises:
|
|
1084
|
+
ValueError: When required parameters are missing or invalid:
|
|
1085
|
+
- Empty or None values for required fields
|
|
1086
|
+
- Invalid GUID format
|
|
1087
|
+
- Out-of-range values
|
|
1088
|
+
|
|
1089
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1090
|
+
- DefaultAzureCredential not configured
|
|
1091
|
+
- Insufficient permissions
|
|
1092
|
+
- Expired authentication token
|
|
1093
|
+
|
|
1094
|
+
HTTPError: When Purview API returns error:
|
|
1095
|
+
- 400: Bad request (invalid parameters)
|
|
1096
|
+
- 401: Unauthorized (authentication failed)
|
|
1097
|
+
- 403: Forbidden (insufficient permissions)
|
|
1098
|
+
- 404: Resource not found
|
|
1099
|
+
- 429: Rate limit exceeded
|
|
1100
|
+
- 500: Internal server error
|
|
1101
|
+
|
|
1102
|
+
NetworkError: When network connectivity fails
|
|
1103
|
+
|
|
1104
|
+
Example:
|
|
1105
|
+
# Basic usage
|
|
1106
|
+
client = Glossary()
|
|
1107
|
+
|
|
1108
|
+
result = client.glossaryReadCategoryTerms(args=...)
|
|
1109
|
+
print(f"Result: {result}")
|
|
1110
|
+
|
|
1111
|
+
Use Cases:
|
|
1112
|
+
- Data Discovery: Find and explore data assets
|
|
1113
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1114
|
+
- Reporting: Generate catalog reports
|
|
1115
|
+
"""
|
|
1116
|
+
self.method = "GET"
|
|
1117
|
+
self.endpoint = ENDPOINTS["glossary"]["category_terms"].format(categoryGuid=args["--categoryGuid"])
|
|
1118
|
+
self.params = {
|
|
1119
|
+
**get_api_version_params("datamap"),
|
|
1120
|
+
"limit": args.get("--limit"),
|
|
1121
|
+
"offset": args.get("--offset"),
|
|
1122
|
+
"sort": args.get("--sort"),
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
@decorator
|
|
1126
|
+
def glossaryReadCategoriesByGlossary(self, args):
|
|
1127
|
+
"""
|
|
1128
|
+
Retrieve glossary category information.
|
|
1129
|
+
|
|
1130
|
+
Retrieves detailed information about the specified glossary category.
|
|
1131
|
+
Returns complete glossary category metadata and properties.
|
|
1132
|
+
|
|
1133
|
+
Args:
|
|
1134
|
+
args: Dictionary of operation arguments.
|
|
1135
|
+
Contains operation-specific parameters.
|
|
1136
|
+
See method implementation for details.
|
|
1137
|
+
|
|
1138
|
+
Returns:
|
|
1139
|
+
Dictionary containing glossary category information:
|
|
1140
|
+
{
|
|
1141
|
+
'guid': str, # Unique identifier
|
|
1142
|
+
'name': str, # Resource name
|
|
1143
|
+
'attributes': dict, # Resource attributes
|
|
1144
|
+
'status': str, # Resource status
|
|
1145
|
+
'updateTime': int # Last update timestamp
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
Raises:
|
|
1149
|
+
ValueError: When required parameters are missing or invalid:
|
|
1150
|
+
- Empty or None values for required fields
|
|
1151
|
+
- Invalid GUID format
|
|
1152
|
+
- Out-of-range values
|
|
1153
|
+
|
|
1154
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1155
|
+
- DefaultAzureCredential not configured
|
|
1156
|
+
- Insufficient permissions
|
|
1157
|
+
- Expired authentication token
|
|
1158
|
+
|
|
1159
|
+
HTTPError: When Purview API returns error:
|
|
1160
|
+
- 400: Bad request (invalid parameters)
|
|
1161
|
+
- 401: Unauthorized (authentication failed)
|
|
1162
|
+
- 403: Forbidden (insufficient permissions)
|
|
1163
|
+
- 404: Resource not found
|
|
1164
|
+
- 429: Rate limit exceeded
|
|
1165
|
+
- 500: Internal server error
|
|
1166
|
+
|
|
1167
|
+
NetworkError: When network connectivity fails
|
|
1168
|
+
|
|
1169
|
+
Example:
|
|
1170
|
+
# Basic usage
|
|
1171
|
+
client = Glossary()
|
|
1172
|
+
|
|
1173
|
+
result = client.glossaryReadCategoriesByGlossary(args=...)
|
|
1174
|
+
print(f"Result: {result}")
|
|
1175
|
+
|
|
1176
|
+
Use Cases:
|
|
1177
|
+
- Data Discovery: Find and explore data assets
|
|
1178
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1179
|
+
- Reporting: Generate catalog reports
|
|
1180
|
+
"""
|
|
1181
|
+
self.method = "GET"
|
|
1182
|
+
self.endpoint = ENDPOINTS["glossary"]["list_categories"].format(glossaryId=args["--glossaryGuid"])
|
|
1183
|
+
self.params = {
|
|
1184
|
+
**get_api_version_params("datamap"),
|
|
1185
|
+
"limit": args.get("--limit"),
|
|
1186
|
+
"offset": args.get("--offset"),
|
|
1187
|
+
"sort": args.get("--sort"),
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
@decorator
|
|
1191
|
+
def glossaryReadCategoriesHeaders(self, args):
|
|
1192
|
+
"""
|
|
1193
|
+
Retrieve glossary category information.
|
|
1194
|
+
|
|
1195
|
+
Retrieves detailed information about the specified glossary category.
|
|
1196
|
+
Returns complete glossary category metadata and properties.
|
|
1197
|
+
|
|
1198
|
+
Args:
|
|
1199
|
+
args: Dictionary of operation arguments.
|
|
1200
|
+
Contains operation-specific parameters.
|
|
1201
|
+
See method implementation for details.
|
|
1202
|
+
|
|
1203
|
+
Returns:
|
|
1204
|
+
Dictionary containing glossary category information:
|
|
1205
|
+
{
|
|
1206
|
+
'guid': str, # Unique identifier
|
|
1207
|
+
'name': str, # Resource name
|
|
1208
|
+
'attributes': dict, # Resource attributes
|
|
1209
|
+
'status': str, # Resource status
|
|
1210
|
+
'updateTime': int # Last update timestamp
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
Raises:
|
|
1214
|
+
ValueError: When required parameters are missing or invalid:
|
|
1215
|
+
- Empty or None values for required fields
|
|
1216
|
+
- Invalid GUID format
|
|
1217
|
+
- Out-of-range values
|
|
1218
|
+
|
|
1219
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1220
|
+
- DefaultAzureCredential not configured
|
|
1221
|
+
- Insufficient permissions
|
|
1222
|
+
- Expired authentication token
|
|
1223
|
+
|
|
1224
|
+
HTTPError: When Purview API returns error:
|
|
1225
|
+
- 400: Bad request (invalid parameters)
|
|
1226
|
+
- 401: Unauthorized (authentication failed)
|
|
1227
|
+
- 403: Forbidden (insufficient permissions)
|
|
1228
|
+
- 404: Resource not found
|
|
1229
|
+
- 429: Rate limit exceeded
|
|
1230
|
+
- 500: Internal server error
|
|
1231
|
+
|
|
1232
|
+
NetworkError: When network connectivity fails
|
|
1233
|
+
|
|
1234
|
+
Example:
|
|
1235
|
+
# Basic usage
|
|
1236
|
+
client = Glossary()
|
|
1237
|
+
|
|
1238
|
+
result = client.glossaryReadCategoriesHeaders(args=...)
|
|
1239
|
+
print(f"Result: {result}")
|
|
1240
|
+
|
|
1241
|
+
Use Cases:
|
|
1242
|
+
- Data Discovery: Find and explore data assets
|
|
1243
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1244
|
+
- Reporting: Generate catalog reports
|
|
1245
|
+
"""
|
|
1246
|
+
self.method = "GET"
|
|
1247
|
+
self.endpoint = ENDPOINTS["glossary"]["categories_headers"].format(glossaryGuid=args["--glossaryGuid"])
|
|
1248
|
+
self.params = {
|
|
1249
|
+
**get_api_version_params("datamap"),
|
|
1250
|
+
"limit": args.get("--limit"),
|
|
1251
|
+
"offset": args.get("--offset"),
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
# === GLOSSARY TERM OPERATIONS ===
|
|
1255
|
+
|
|
1256
|
+
@decorator
|
|
1257
|
+
@decorator
|
|
1258
|
+
def glossaryReadTerms(self, args):
|
|
1259
|
+
"""
|
|
1260
|
+
Retrieve glossary term information.
|
|
1261
|
+
|
|
1262
|
+
Retrieves detailed information about the specified glossary term.
|
|
1263
|
+
Returns complete glossary term metadata and properties.
|
|
1264
|
+
|
|
1265
|
+
Args:
|
|
1266
|
+
args: Dictionary of operation arguments.
|
|
1267
|
+
Contains operation-specific parameters.
|
|
1268
|
+
See method implementation for details.
|
|
1269
|
+
|
|
1270
|
+
Returns:
|
|
1271
|
+
Dictionary containing glossary term information:
|
|
1272
|
+
{
|
|
1273
|
+
'guid': str, # Unique identifier
|
|
1274
|
+
'name': str, # Resource name
|
|
1275
|
+
'attributes': dict, # Resource attributes
|
|
1276
|
+
'status': str, # Resource status
|
|
1277
|
+
'updateTime': int # Last update timestamp
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
Raises:
|
|
1281
|
+
ValueError: When required parameters are missing or invalid:
|
|
1282
|
+
- Empty or None values for required fields
|
|
1283
|
+
- Invalid GUID format
|
|
1284
|
+
- Out-of-range values
|
|
1285
|
+
|
|
1286
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1287
|
+
- DefaultAzureCredential not configured
|
|
1288
|
+
- Insufficient permissions
|
|
1289
|
+
- Expired authentication token
|
|
1290
|
+
|
|
1291
|
+
HTTPError: When Purview API returns error:
|
|
1292
|
+
- 400: Bad request (invalid parameters)
|
|
1293
|
+
- 401: Unauthorized (authentication failed)
|
|
1294
|
+
- 403: Forbidden (insufficient permissions)
|
|
1295
|
+
- 404: Resource not found
|
|
1296
|
+
- 429: Rate limit exceeded
|
|
1297
|
+
- 500: Internal server error
|
|
1298
|
+
|
|
1299
|
+
NetworkError: When network connectivity fails
|
|
1300
|
+
|
|
1301
|
+
Example:
|
|
1302
|
+
# Basic usage
|
|
1303
|
+
client = Glossary()
|
|
1304
|
+
|
|
1305
|
+
result = client.glossaryReadTerms(args=...)
|
|
1306
|
+
print(f"Result: {result}")
|
|
1307
|
+
|
|
1308
|
+
Use Cases:
|
|
1309
|
+
- Data Discovery: Find and explore data assets
|
|
1310
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1311
|
+
- Reporting: Generate catalog reports
|
|
1312
|
+
"""
|
|
1313
|
+
self.method = "GET"
|
|
1314
|
+
self.endpoint = ENDPOINTS["glossary"]["list_terms"].format(glossaryId=args["--glossaryGuid"])
|
|
1315
|
+
self.params = {
|
|
1316
|
+
**get_api_version_params("datamap"),
|
|
1317
|
+
"limit": args.get("--limit"),
|
|
1318
|
+
"offset": args.get("--offset"),
|
|
1319
|
+
"sort": args.get("--sort"),
|
|
1320
|
+
"extInfo": str(args.get("--extInfo", False)).lower(),
|
|
1321
|
+
"includeTermHierarchy": str(args.get("--includeTermHierarchy", False)).lower(),
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
@decorator
|
|
1325
|
+
def glossaryCreateTerms(self, args):
|
|
1326
|
+
"""
|
|
1327
|
+
Create a new glossary term.
|
|
1328
|
+
|
|
1329
|
+
Creates a new glossary term in Microsoft Purview.
|
|
1330
|
+
Requires appropriate permissions and valid glossary term definition.
|
|
1331
|
+
|
|
1332
|
+
Args:
|
|
1333
|
+
args: Dictionary of operation arguments.
|
|
1334
|
+
Contains operation-specific parameters.
|
|
1335
|
+
See method implementation for details.
|
|
1336
|
+
|
|
1337
|
+
Returns:
|
|
1338
|
+
Dictionary containing created glossary term:
|
|
1339
|
+
{
|
|
1340
|
+
'guid': str, # Unique identifier
|
|
1341
|
+
'name': str, # Resource name
|
|
1342
|
+
'status': str, # Creation status
|
|
1343
|
+
'attributes': dict, # Resource attributes
|
|
1344
|
+
'createTime': int # Creation timestamp
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
Raises:
|
|
1348
|
+
ValueError: When required parameters are missing or invalid:
|
|
1349
|
+
- Empty or None values for required fields
|
|
1350
|
+
- Invalid GUID format
|
|
1351
|
+
- Out-of-range values
|
|
1352
|
+
|
|
1353
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1354
|
+
- DefaultAzureCredential not configured
|
|
1355
|
+
- Insufficient permissions
|
|
1356
|
+
- Expired authentication token
|
|
1357
|
+
|
|
1358
|
+
HTTPError: When Purview API returns error:
|
|
1359
|
+
- 400: Bad request (invalid parameters)
|
|
1360
|
+
- 401: Unauthorized (authentication failed)
|
|
1361
|
+
- 403: Forbidden (insufficient permissions)
|
|
1362
|
+
- 404: Resource not found
|
|
1363
|
+
- 409: Conflict (resource already exists)
|
|
1364
|
+
- 429: Rate limit exceeded
|
|
1365
|
+
- 500: Internal server error
|
|
1366
|
+
|
|
1367
|
+
NetworkError: When network connectivity fails
|
|
1368
|
+
|
|
1369
|
+
Example:
|
|
1370
|
+
# Basic usage
|
|
1371
|
+
client = Glossary()
|
|
1372
|
+
|
|
1373
|
+
result = client.glossaryCreateTerms(args=...)
|
|
1374
|
+
print(f"Result: {result}")
|
|
1375
|
+
|
|
1376
|
+
# With detailed data
|
|
1377
|
+
data = {
|
|
1378
|
+
'name': 'My Resource',
|
|
1379
|
+
'description': 'Resource description',
|
|
1380
|
+
'attributes': {
|
|
1381
|
+
'key1': 'value1',
|
|
1382
|
+
'key2': 'value2'
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
result = client.glossaryCreateTerms(data)
|
|
1387
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1388
|
+
|
|
1389
|
+
Use Cases:
|
|
1390
|
+
- Data Onboarding: Register new data sources in catalog
|
|
1391
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
1392
|
+
- Automation: Programmatically populate catalog
|
|
1393
|
+
"""
|
|
1394
|
+
self.method = "POST"
|
|
1395
|
+
self.endpoint = ENDPOINTS["glossary"]["create_terms"]
|
|
1396
|
+
self.params = get_api_version_params("datamap")
|
|
1397
|
+
payload = get_json(args, "--payloadFile")
|
|
1398
|
+
if isinstance(payload, list):
|
|
1399
|
+
self.payload = payload
|
|
1400
|
+
elif isinstance(payload, dict) and "terms" in payload:
|
|
1401
|
+
self.payload = payload["terms"]
|
|
1402
|
+
else:
|
|
1403
|
+
raise ValueError("Terms payload must be a list or a dict with 'terms' key.")
|
|
1404
|
+
|
|
1405
|
+
@decorator
|
|
1406
|
+
def glossaryCreateTerm(self, args):
|
|
1407
|
+
"""
|
|
1408
|
+
Create a new glossary term.
|
|
1409
|
+
|
|
1410
|
+
Creates a new glossary term in Microsoft Purview.
|
|
1411
|
+
Requires appropriate permissions and valid glossary term definition.
|
|
1412
|
+
|
|
1413
|
+
Args:
|
|
1414
|
+
args: Dictionary of operation arguments.
|
|
1415
|
+
Contains operation-specific parameters.
|
|
1416
|
+
See method implementation for details.
|
|
1417
|
+
|
|
1418
|
+
Returns:
|
|
1419
|
+
Dictionary containing created glossary term:
|
|
1420
|
+
{
|
|
1421
|
+
'guid': str, # Unique identifier
|
|
1422
|
+
'name': str, # Resource name
|
|
1423
|
+
'status': str, # Creation status
|
|
1424
|
+
'attributes': dict, # Resource attributes
|
|
1425
|
+
'createTime': int # Creation timestamp
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
Raises:
|
|
1429
|
+
ValueError: When required parameters are missing or invalid:
|
|
1430
|
+
- Empty or None values for required fields
|
|
1431
|
+
- Invalid GUID format
|
|
1432
|
+
- Out-of-range values
|
|
1433
|
+
|
|
1434
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1435
|
+
- DefaultAzureCredential not configured
|
|
1436
|
+
- Insufficient permissions
|
|
1437
|
+
- Expired authentication token
|
|
1438
|
+
|
|
1439
|
+
HTTPError: When Purview API returns error:
|
|
1440
|
+
- 400: Bad request (invalid parameters)
|
|
1441
|
+
- 401: Unauthorized (authentication failed)
|
|
1442
|
+
- 403: Forbidden (insufficient permissions)
|
|
1443
|
+
- 404: Resource not found
|
|
1444
|
+
- 409: Conflict (resource already exists)
|
|
1445
|
+
- 429: Rate limit exceeded
|
|
1446
|
+
- 500: Internal server error
|
|
1447
|
+
|
|
1448
|
+
NetworkError: When network connectivity fails
|
|
1449
|
+
|
|
1450
|
+
Example:
|
|
1451
|
+
# Basic usage
|
|
1452
|
+
client = Glossary()
|
|
1453
|
+
|
|
1454
|
+
result = client.glossaryCreateTerm(args=...)
|
|
1455
|
+
print(f"Result: {result}")
|
|
1456
|
+
|
|
1457
|
+
# With detailed data
|
|
1458
|
+
data = {
|
|
1459
|
+
'name': 'My Resource',
|
|
1460
|
+
'description': 'Resource description',
|
|
1461
|
+
'attributes': {
|
|
1462
|
+
'key1': 'value1',
|
|
1463
|
+
'key2': 'value2'
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
result = client.glossaryCreateTerm(data)
|
|
1468
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1469
|
+
|
|
1470
|
+
Use Cases:
|
|
1471
|
+
- Data Onboarding: Register new data sources in catalog
|
|
1472
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
1473
|
+
- Automation: Programmatically populate catalog
|
|
1474
|
+
"""
|
|
1475
|
+
self.method = "POST"
|
|
1476
|
+
self.endpoint = ENDPOINTS["glossary"]["create_term"]
|
|
1477
|
+
self.params = get_api_version_params("datamap")
|
|
1478
|
+
payload = get_json(args, "--payloadFile")
|
|
1479
|
+
if not isinstance(payload, dict):
|
|
1480
|
+
raise ValueError(f"Term payload must be a JSON object (dict). Got: {type(payload)}")
|
|
1481
|
+
self.payload = payload
|
|
1482
|
+
|
|
1483
|
+
@decorator
|
|
1484
|
+
def glossaryReadTerm(self, args):
|
|
1485
|
+
"""
|
|
1486
|
+
Retrieve glossary term information.
|
|
1487
|
+
|
|
1488
|
+
Retrieves detailed information about the specified glossary term.
|
|
1489
|
+
Returns complete glossary term metadata and properties.
|
|
1490
|
+
|
|
1491
|
+
Args:
|
|
1492
|
+
args: Dictionary of operation arguments.
|
|
1493
|
+
Contains operation-specific parameters.
|
|
1494
|
+
See method implementation for details.
|
|
1495
|
+
|
|
1496
|
+
Returns:
|
|
1497
|
+
Dictionary containing glossary term information:
|
|
1498
|
+
{
|
|
1499
|
+
'guid': str, # Unique identifier
|
|
1500
|
+
'name': str, # Resource name
|
|
1501
|
+
'attributes': dict, # Resource attributes
|
|
1502
|
+
'status': str, # Resource status
|
|
1503
|
+
'updateTime': int # Last update timestamp
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
Raises:
|
|
1507
|
+
ValueError: When required parameters are missing or invalid:
|
|
1508
|
+
- Empty or None values for required fields
|
|
1509
|
+
- Invalid GUID format
|
|
1510
|
+
- Out-of-range values
|
|
1511
|
+
|
|
1512
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1513
|
+
- DefaultAzureCredential not configured
|
|
1514
|
+
- Insufficient permissions
|
|
1515
|
+
- Expired authentication token
|
|
1516
|
+
|
|
1517
|
+
HTTPError: When Purview API returns error:
|
|
1518
|
+
- 400: Bad request (invalid parameters)
|
|
1519
|
+
- 401: Unauthorized (authentication failed)
|
|
1520
|
+
- 403: Forbidden (insufficient permissions)
|
|
1521
|
+
- 404: Resource not found
|
|
1522
|
+
- 429: Rate limit exceeded
|
|
1523
|
+
- 500: Internal server error
|
|
1524
|
+
|
|
1525
|
+
NetworkError: When network connectivity fails
|
|
1526
|
+
|
|
1527
|
+
Example:
|
|
1528
|
+
# Basic usage
|
|
1529
|
+
client = Glossary()
|
|
1530
|
+
|
|
1531
|
+
result = client.glossaryReadTerm(args=...)
|
|
1532
|
+
print(f"Result: {result}")
|
|
1533
|
+
|
|
1534
|
+
Use Cases:
|
|
1535
|
+
- Data Discovery: Find and explore data assets
|
|
1536
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1537
|
+
- Reporting: Generate catalog reports
|
|
1538
|
+
"""
|
|
1539
|
+
self.method = "GET"
|
|
1540
|
+
self.endpoint = ENDPOINTS["glossary"]["get_term"].format(termId=args["--termGuid"])
|
|
1541
|
+
self.params = {
|
|
1542
|
+
**get_api_version_params("datamap"),
|
|
1543
|
+
"includeTermHierarchy": str(args.get("--includeTermHierarchy", False)).lower(),
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
@decorator
|
|
1547
|
+
def glossaryUpdateTerm(self, args):
|
|
1548
|
+
"""
|
|
1549
|
+
Update an existing glossary term.
|
|
1550
|
+
|
|
1551
|
+
Updates an existing glossary term with new values.
|
|
1552
|
+
Only specified fields are modified; others remain unchanged.
|
|
1553
|
+
|
|
1554
|
+
Args:
|
|
1555
|
+
args: Dictionary of operation arguments.
|
|
1556
|
+
Contains operation-specific parameters.
|
|
1557
|
+
See method implementation for details.
|
|
1558
|
+
|
|
1559
|
+
Returns:
|
|
1560
|
+
Dictionary containing updated glossary term:
|
|
1561
|
+
{
|
|
1562
|
+
'guid': str, # Unique identifier
|
|
1563
|
+
'attributes': dict, # Updated attributes
|
|
1564
|
+
'updateTime': int # Update timestamp
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
Raises:
|
|
1568
|
+
ValueError: When required parameters are missing or invalid:
|
|
1569
|
+
- Empty or None values for required fields
|
|
1570
|
+
- Invalid GUID format
|
|
1571
|
+
- Out-of-range values
|
|
1572
|
+
|
|
1573
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1574
|
+
- DefaultAzureCredential not configured
|
|
1575
|
+
- Insufficient permissions
|
|
1576
|
+
- Expired authentication token
|
|
1577
|
+
|
|
1578
|
+
HTTPError: When Purview API returns error:
|
|
1579
|
+
- 400: Bad request (invalid parameters)
|
|
1580
|
+
- 401: Unauthorized (authentication failed)
|
|
1581
|
+
- 403: Forbidden (insufficient permissions)
|
|
1582
|
+
- 404: Resource not found
|
|
1583
|
+
- 429: Rate limit exceeded
|
|
1584
|
+
- 500: Internal server error
|
|
1585
|
+
|
|
1586
|
+
NetworkError: When network connectivity fails
|
|
1587
|
+
|
|
1588
|
+
Example:
|
|
1589
|
+
# Basic usage
|
|
1590
|
+
client = Glossary()
|
|
1591
|
+
|
|
1592
|
+
result = client.glossaryUpdateTerm(args=...)
|
|
1593
|
+
print(f"Result: {result}")
|
|
1594
|
+
|
|
1595
|
+
# With detailed data
|
|
1596
|
+
data = {
|
|
1597
|
+
'name': 'My Resource',
|
|
1598
|
+
'description': 'Resource description',
|
|
1599
|
+
'attributes': {
|
|
1600
|
+
'key1': 'value1',
|
|
1601
|
+
'key2': 'value2'
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
result = client.glossaryUpdateTerm(data)
|
|
1606
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1607
|
+
|
|
1608
|
+
Use Cases:
|
|
1609
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
1610
|
+
- Ownership Changes: Reassign data ownership
|
|
1611
|
+
- Classification: Apply or modify data classifications
|
|
1612
|
+
"""
|
|
1613
|
+
self.method = "PUT"
|
|
1614
|
+
self.endpoint = ENDPOINTS["glossary"]["update_term"].format(termId=args["--termGuid"])
|
|
1615
|
+
self.params = get_api_version_params("datamap")
|
|
1616
|
+
self.payload = get_json(args, "--payloadFile")
|
|
1617
|
+
|
|
1618
|
+
@decorator
|
|
1619
|
+
def glossaryDeleteTerm(self, args):
|
|
1620
|
+
"""
|
|
1621
|
+
Delete a glossary term.
|
|
1622
|
+
|
|
1623
|
+
Permanently deletes the specified glossary term.
|
|
1624
|
+
This operation cannot be undone. Use with caution.
|
|
1625
|
+
|
|
1626
|
+
Args:
|
|
1627
|
+
args: Dictionary of operation arguments.
|
|
1628
|
+
Contains operation-specific parameters.
|
|
1629
|
+
See method implementation for details.
|
|
1630
|
+
|
|
1631
|
+
Returns:
|
|
1632
|
+
Dictionary with deletion status:
|
|
1633
|
+
{
|
|
1634
|
+
'guid': str, # Deleted resource ID
|
|
1635
|
+
'status': str, # Deletion status
|
|
1636
|
+
'message': str # Confirmation message
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
Raises:
|
|
1640
|
+
ValueError: When required parameters are missing or invalid:
|
|
1641
|
+
- Empty or None values for required fields
|
|
1642
|
+
- Invalid GUID format
|
|
1643
|
+
- Out-of-range values
|
|
1644
|
+
|
|
1645
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1646
|
+
- DefaultAzureCredential not configured
|
|
1647
|
+
- Insufficient permissions
|
|
1648
|
+
- Expired authentication token
|
|
1649
|
+
|
|
1650
|
+
HTTPError: When Purview API returns error:
|
|
1651
|
+
- 400: Bad request (invalid parameters)
|
|
1652
|
+
- 401: Unauthorized (authentication failed)
|
|
1653
|
+
- 403: Forbidden (insufficient permissions)
|
|
1654
|
+
- 404: Resource not found
|
|
1655
|
+
- 429: Rate limit exceeded
|
|
1656
|
+
- 500: Internal server error
|
|
1657
|
+
|
|
1658
|
+
NetworkError: When network connectivity fails
|
|
1659
|
+
|
|
1660
|
+
Example:
|
|
1661
|
+
# Basic usage
|
|
1662
|
+
client = Glossary()
|
|
1663
|
+
|
|
1664
|
+
result = client.glossaryDeleteTerm(args=...)
|
|
1665
|
+
print(f"Result: {result}")
|
|
1666
|
+
|
|
1667
|
+
Use Cases:
|
|
1668
|
+
- Data Cleanup: Remove obsolete or test data
|
|
1669
|
+
- Decommissioning: Delete resources no longer in use
|
|
1670
|
+
- Testing: Clean up test environments
|
|
1671
|
+
"""
|
|
1672
|
+
self.method = "DELETE"
|
|
1673
|
+
self.endpoint = ENDPOINTS["glossary"]["delete_term"].format(termId=args["--termGuid"])
|
|
1674
|
+
self.params = get_api_version_params("datamap")
|
|
1675
|
+
|
|
1676
|
+
@decorator
|
|
1677
|
+
def glossaryReadTermPartial(self, args):
|
|
1678
|
+
"""
|
|
1679
|
+
Retrieve glossary term information.
|
|
1680
|
+
|
|
1681
|
+
Retrieves detailed information about the specified glossary term.
|
|
1682
|
+
Returns complete glossary term metadata and properties.
|
|
1683
|
+
|
|
1684
|
+
Args:
|
|
1685
|
+
args: Dictionary of operation arguments.
|
|
1686
|
+
Contains operation-specific parameters.
|
|
1687
|
+
See method implementation for details.
|
|
1688
|
+
|
|
1689
|
+
Returns:
|
|
1690
|
+
Dictionary containing glossary term information:
|
|
1691
|
+
{
|
|
1692
|
+
'guid': str, # Unique identifier
|
|
1693
|
+
'name': str, # Resource name
|
|
1694
|
+
'attributes': dict, # Resource attributes
|
|
1695
|
+
'status': str, # Resource status
|
|
1696
|
+
'updateTime': int # Last update timestamp
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
Raises:
|
|
1700
|
+
ValueError: When required parameters are missing or invalid:
|
|
1701
|
+
- Empty or None values for required fields
|
|
1702
|
+
- Invalid GUID format
|
|
1703
|
+
- Out-of-range values
|
|
1704
|
+
|
|
1705
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1706
|
+
- DefaultAzureCredential not configured
|
|
1707
|
+
- Insufficient permissions
|
|
1708
|
+
- Expired authentication token
|
|
1709
|
+
|
|
1710
|
+
HTTPError: When Purview API returns error:
|
|
1711
|
+
- 400: Bad request (invalid parameters)
|
|
1712
|
+
- 401: Unauthorized (authentication failed)
|
|
1713
|
+
- 403: Forbidden (insufficient permissions)
|
|
1714
|
+
- 404: Resource not found
|
|
1715
|
+
- 429: Rate limit exceeded
|
|
1716
|
+
- 500: Internal server error
|
|
1717
|
+
|
|
1718
|
+
NetworkError: When network connectivity fails
|
|
1719
|
+
|
|
1720
|
+
Example:
|
|
1721
|
+
# Basic usage
|
|
1722
|
+
client = Glossary()
|
|
1723
|
+
|
|
1724
|
+
result = client.glossaryReadTermPartial(args=...)
|
|
1725
|
+
print(f"Result: {result}")
|
|
1726
|
+
|
|
1727
|
+
Use Cases:
|
|
1728
|
+
- Data Discovery: Find and explore data assets
|
|
1729
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1730
|
+
- Reporting: Generate catalog reports
|
|
1731
|
+
"""
|
|
1732
|
+
self.method = "GET"
|
|
1733
|
+
self.endpoint = ENDPOINTS["glossary"]["term_partial"].format(termGuid=args["--termGuid"])
|
|
1734
|
+
self.params = get_api_version_params("datamap")
|
|
1735
|
+
|
|
1736
|
+
@decorator
|
|
1737
|
+
def glossaryUpdateTermPartial(self, args):
|
|
1738
|
+
"""
|
|
1739
|
+
Update an existing glossary term.
|
|
1740
|
+
|
|
1741
|
+
Updates an existing glossary term with new values.
|
|
1742
|
+
Only specified fields are modified; others remain unchanged.
|
|
1743
|
+
|
|
1744
|
+
Args:
|
|
1745
|
+
args: Dictionary of operation arguments.
|
|
1746
|
+
Contains operation-specific parameters.
|
|
1747
|
+
See method implementation for details.
|
|
1748
|
+
|
|
1749
|
+
Returns:
|
|
1750
|
+
Dictionary containing updated glossary term:
|
|
1751
|
+
{
|
|
1752
|
+
'guid': str, # Unique identifier
|
|
1753
|
+
'attributes': dict, # Updated attributes
|
|
1754
|
+
'updateTime': int # Update timestamp
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
Raises:
|
|
1758
|
+
ValueError: When required parameters are missing or invalid:
|
|
1759
|
+
- Empty or None values for required fields
|
|
1760
|
+
- Invalid GUID format
|
|
1761
|
+
- Out-of-range values
|
|
1762
|
+
|
|
1763
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1764
|
+
- DefaultAzureCredential not configured
|
|
1765
|
+
- Insufficient permissions
|
|
1766
|
+
- Expired authentication token
|
|
1767
|
+
|
|
1768
|
+
HTTPError: When Purview API returns error:
|
|
1769
|
+
- 400: Bad request (invalid parameters)
|
|
1770
|
+
- 401: Unauthorized (authentication failed)
|
|
1771
|
+
- 403: Forbidden (insufficient permissions)
|
|
1772
|
+
- 404: Resource not found
|
|
1773
|
+
- 429: Rate limit exceeded
|
|
1774
|
+
- 500: Internal server error
|
|
1775
|
+
|
|
1776
|
+
NetworkError: When network connectivity fails
|
|
1777
|
+
|
|
1778
|
+
Example:
|
|
1779
|
+
# Basic usage
|
|
1780
|
+
client = Glossary()
|
|
1781
|
+
|
|
1782
|
+
result = client.glossaryUpdateTermPartial(args=...)
|
|
1783
|
+
print(f"Result: {result}")
|
|
1784
|
+
|
|
1785
|
+
# With detailed data
|
|
1786
|
+
data = {
|
|
1787
|
+
'name': 'My Resource',
|
|
1788
|
+
'description': 'Resource description',
|
|
1789
|
+
'attributes': {
|
|
1790
|
+
'key1': 'value1',
|
|
1791
|
+
'key2': 'value2'
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
result = client.glossaryUpdateTermPartial(data)
|
|
1796
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1797
|
+
|
|
1798
|
+
Use Cases:
|
|
1799
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
1800
|
+
- Ownership Changes: Reassign data ownership
|
|
1801
|
+
- Classification: Apply or modify data classifications
|
|
1802
|
+
"""
|
|
1803
|
+
self.method = "PUT"
|
|
1804
|
+
self.endpoint = ENDPOINTS["glossary"]["term_partial"].format(termGuid=args["--termGuid"])
|
|
1805
|
+
self.params = get_api_version_params("datamap")
|
|
1806
|
+
self.payload = get_json(args, "--payloadFile")
|
|
1807
|
+
|
|
1808
|
+
@decorator
|
|
1809
|
+
def glossaryReadTermAssignedEntities(self, args):
|
|
1810
|
+
"""
|
|
1811
|
+
Retrieve glossary term information.
|
|
1812
|
+
|
|
1813
|
+
Retrieves detailed information about the specified glossary term.
|
|
1814
|
+
Returns complete glossary term metadata and properties.
|
|
1815
|
+
|
|
1816
|
+
Args:
|
|
1817
|
+
args: Dictionary of operation arguments.
|
|
1818
|
+
Contains operation-specific parameters.
|
|
1819
|
+
See method implementation for details.
|
|
1820
|
+
|
|
1821
|
+
Returns:
|
|
1822
|
+
Dictionary containing glossary term information:
|
|
1823
|
+
{
|
|
1824
|
+
'guid': str, # Unique identifier
|
|
1825
|
+
'name': str, # Resource name
|
|
1826
|
+
'attributes': dict, # Resource attributes
|
|
1827
|
+
'status': str, # Resource status
|
|
1828
|
+
'updateTime': int # Last update timestamp
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
Raises:
|
|
1832
|
+
ValueError: When required parameters are missing or invalid:
|
|
1833
|
+
- Empty or None values for required fields
|
|
1834
|
+
- Invalid GUID format
|
|
1835
|
+
- Out-of-range values
|
|
1836
|
+
|
|
1837
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1838
|
+
- DefaultAzureCredential not configured
|
|
1839
|
+
- Insufficient permissions
|
|
1840
|
+
- Expired authentication token
|
|
1841
|
+
|
|
1842
|
+
HTTPError: When Purview API returns error:
|
|
1843
|
+
- 400: Bad request (invalid parameters)
|
|
1844
|
+
- 401: Unauthorized (authentication failed)
|
|
1845
|
+
- 403: Forbidden (insufficient permissions)
|
|
1846
|
+
- 404: Resource not found
|
|
1847
|
+
- 429: Rate limit exceeded
|
|
1848
|
+
- 500: Internal server error
|
|
1849
|
+
|
|
1850
|
+
NetworkError: When network connectivity fails
|
|
1851
|
+
|
|
1852
|
+
Example:
|
|
1853
|
+
# Basic usage
|
|
1854
|
+
client = Glossary()
|
|
1855
|
+
|
|
1856
|
+
result = client.glossaryReadTermAssignedEntities(args=...)
|
|
1857
|
+
print(f"Result: {result}")
|
|
1858
|
+
|
|
1859
|
+
Use Cases:
|
|
1860
|
+
- Data Discovery: Find and explore data assets
|
|
1861
|
+
- Compliance Auditing: Review metadata and classifications
|
|
1862
|
+
- Reporting: Generate catalog reports
|
|
1863
|
+
"""
|
|
1864
|
+
self.method = "GET"
|
|
1865
|
+
self.endpoint = ENDPOINTS["glossary"]["term_assigned_entities"].format(termGuid=args["--termGuid"])
|
|
1866
|
+
self.params = {
|
|
1867
|
+
**get_api_version_params("datamap"),
|
|
1868
|
+
"limit": args.get("--limit"),
|
|
1869
|
+
"offset": args.get("--offset"),
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
@decorator
|
|
1873
|
+
def glossaryCreateTermAssignedEntities(self, args):
|
|
1874
|
+
"""
|
|
1875
|
+
Create a new glossary term.
|
|
1876
|
+
|
|
1877
|
+
Creates a new glossary term in Microsoft Purview.
|
|
1878
|
+
Requires appropriate permissions and valid glossary term definition.
|
|
1879
|
+
|
|
1880
|
+
Args:
|
|
1881
|
+
args: Dictionary of operation arguments.
|
|
1882
|
+
Contains operation-specific parameters.
|
|
1883
|
+
See method implementation for details.
|
|
1884
|
+
|
|
1885
|
+
Returns:
|
|
1886
|
+
Dictionary containing created glossary term:
|
|
1887
|
+
{
|
|
1888
|
+
'guid': str, # Unique identifier
|
|
1889
|
+
'name': str, # Resource name
|
|
1890
|
+
'status': str, # Creation status
|
|
1891
|
+
'attributes': dict, # Resource attributes
|
|
1892
|
+
'createTime': int # Creation timestamp
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
Raises:
|
|
1896
|
+
ValueError: When required parameters are missing or invalid:
|
|
1897
|
+
- Empty or None values for required fields
|
|
1898
|
+
- Invalid GUID format
|
|
1899
|
+
- Out-of-range values
|
|
1900
|
+
|
|
1901
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1902
|
+
- DefaultAzureCredential not configured
|
|
1903
|
+
- Insufficient permissions
|
|
1904
|
+
- Expired authentication token
|
|
1905
|
+
|
|
1906
|
+
HTTPError: When Purview API returns error:
|
|
1907
|
+
- 400: Bad request (invalid parameters)
|
|
1908
|
+
- 401: Unauthorized (authentication failed)
|
|
1909
|
+
- 403: Forbidden (insufficient permissions)
|
|
1910
|
+
- 404: Resource not found
|
|
1911
|
+
- 409: Conflict (resource already exists)
|
|
1912
|
+
- 429: Rate limit exceeded
|
|
1913
|
+
- 500: Internal server error
|
|
1914
|
+
|
|
1915
|
+
NetworkError: When network connectivity fails
|
|
1916
|
+
|
|
1917
|
+
Example:
|
|
1918
|
+
# Basic usage
|
|
1919
|
+
client = Glossary()
|
|
1920
|
+
|
|
1921
|
+
result = client.glossaryCreateTermAssignedEntities(args=...)
|
|
1922
|
+
print(f"Result: {result}")
|
|
1923
|
+
|
|
1924
|
+
# With detailed data
|
|
1925
|
+
data = {
|
|
1926
|
+
'name': 'My Resource',
|
|
1927
|
+
'description': 'Resource description',
|
|
1928
|
+
'attributes': {
|
|
1929
|
+
'key1': 'value1',
|
|
1930
|
+
'key2': 'value2'
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
result = client.glossaryCreateTermAssignedEntities(data)
|
|
1935
|
+
print(f"Created/Updated: {result['guid']}")
|
|
1936
|
+
|
|
1937
|
+
Use Cases:
|
|
1938
|
+
- Data Onboarding: Register new data sources in catalog
|
|
1939
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
1940
|
+
- Automation: Programmatically populate catalog
|
|
1941
|
+
"""
|
|
1942
|
+
self.method = "POST"
|
|
1943
|
+
self.endpoint = ENDPOINTS["glossary"]["assign_term_to_entities"].format(termId=args["--termGuid"])
|
|
1944
|
+
self.params = get_api_version_params("datamap")
|
|
1945
|
+
self.payload = get_json(args, "--payloadFile")
|
|
1946
|
+
|
|
1947
|
+
@decorator
|
|
1948
|
+
def glossaryDeleteTermAssignedEntities(self, args):
|
|
1949
|
+
"""
|
|
1950
|
+
Delete a glossary term.
|
|
1951
|
+
|
|
1952
|
+
Permanently deletes the specified glossary term.
|
|
1953
|
+
This operation cannot be undone. Use with caution.
|
|
1954
|
+
|
|
1955
|
+
Args:
|
|
1956
|
+
args: Dictionary of operation arguments.
|
|
1957
|
+
Contains operation-specific parameters.
|
|
1958
|
+
See method implementation for details.
|
|
1959
|
+
|
|
1960
|
+
Returns:
|
|
1961
|
+
Dictionary with deletion status:
|
|
1962
|
+
{
|
|
1963
|
+
'guid': str, # Deleted resource ID
|
|
1964
|
+
'status': str, # Deletion status
|
|
1965
|
+
'message': str # Confirmation message
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
Raises:
|
|
1969
|
+
ValueError: When required parameters are missing or invalid:
|
|
1970
|
+
- Empty or None values for required fields
|
|
1971
|
+
- Invalid GUID format
|
|
1972
|
+
- Out-of-range values
|
|
1973
|
+
|
|
1974
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
1975
|
+
- DefaultAzureCredential not configured
|
|
1976
|
+
- Insufficient permissions
|
|
1977
|
+
- Expired authentication token
|
|
1978
|
+
|
|
1979
|
+
HTTPError: When Purview API returns error:
|
|
1980
|
+
- 400: Bad request (invalid parameters)
|
|
1981
|
+
- 401: Unauthorized (authentication failed)
|
|
1982
|
+
- 403: Forbidden (insufficient permissions)
|
|
1983
|
+
- 404: Resource not found
|
|
1984
|
+
- 429: Rate limit exceeded
|
|
1985
|
+
- 500: Internal server error
|
|
1986
|
+
|
|
1987
|
+
NetworkError: When network connectivity fails
|
|
1988
|
+
|
|
1989
|
+
Example:
|
|
1990
|
+
# Basic usage
|
|
1991
|
+
client = Glossary()
|
|
1992
|
+
|
|
1993
|
+
result = client.glossaryDeleteTermAssignedEntities(args=...)
|
|
1994
|
+
print(f"Result: {result}")
|
|
1995
|
+
|
|
1996
|
+
Use Cases:
|
|
1997
|
+
- Data Cleanup: Remove obsolete or test data
|
|
1998
|
+
- Decommissioning: Delete resources no longer in use
|
|
1999
|
+
- Testing: Clean up test environments
|
|
2000
|
+
"""
|
|
2001
|
+
self.method = "DELETE"
|
|
2002
|
+
self.endpoint = ENDPOINTS["glossary"]["delete_term_assignment_from_entities"].format(termId=args["--termGuid"])
|
|
2003
|
+
self.params = get_api_version_params("datamap")
|
|
2004
|
+
self.payload = get_json(args, "--payloadFile")
|
|
2005
|
+
|
|
2006
|
+
@decorator
|
|
2007
|
+
def glossaryReadTermRelated(self, args):
|
|
2008
|
+
"""
|
|
2009
|
+
Retrieve glossary term information.
|
|
2010
|
+
|
|
2011
|
+
Retrieves detailed information about the specified glossary term.
|
|
2012
|
+
Returns complete glossary term metadata and properties.
|
|
2013
|
+
|
|
2014
|
+
Args:
|
|
2015
|
+
args: Dictionary of operation arguments.
|
|
2016
|
+
Contains operation-specific parameters.
|
|
2017
|
+
See method implementation for details.
|
|
2018
|
+
|
|
2019
|
+
Returns:
|
|
2020
|
+
Dictionary containing glossary term information:
|
|
2021
|
+
{
|
|
2022
|
+
'guid': str, # Unique identifier
|
|
2023
|
+
'name': str, # Resource name
|
|
2024
|
+
'attributes': dict, # Resource attributes
|
|
2025
|
+
'status': str, # Resource status
|
|
2026
|
+
'updateTime': int # Last update timestamp
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
Raises:
|
|
2030
|
+
ValueError: When required parameters are missing or invalid:
|
|
2031
|
+
- Empty or None values for required fields
|
|
2032
|
+
- Invalid GUID format
|
|
2033
|
+
- Out-of-range values
|
|
2034
|
+
|
|
2035
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2036
|
+
- DefaultAzureCredential not configured
|
|
2037
|
+
- Insufficient permissions
|
|
2038
|
+
- Expired authentication token
|
|
2039
|
+
|
|
2040
|
+
HTTPError: When Purview API returns error:
|
|
2041
|
+
- 400: Bad request (invalid parameters)
|
|
2042
|
+
- 401: Unauthorized (authentication failed)
|
|
2043
|
+
- 403: Forbidden (insufficient permissions)
|
|
2044
|
+
- 404: Resource not found
|
|
2045
|
+
- 429: Rate limit exceeded
|
|
2046
|
+
- 500: Internal server error
|
|
2047
|
+
|
|
2048
|
+
NetworkError: When network connectivity fails
|
|
2049
|
+
|
|
2050
|
+
Example:
|
|
2051
|
+
# Basic usage
|
|
2052
|
+
client = Glossary()
|
|
2053
|
+
|
|
2054
|
+
result = client.glossaryReadTermRelated(args=...)
|
|
2055
|
+
print(f"Result: {result}")
|
|
2056
|
+
|
|
2057
|
+
Use Cases:
|
|
2058
|
+
- Data Discovery: Find and explore data assets
|
|
2059
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2060
|
+
- Reporting: Generate catalog reports
|
|
2061
|
+
"""
|
|
2062
|
+
self.method = "GET"
|
|
2063
|
+
self.endpoint = ENDPOINTS["glossary"]["term_related"].format(termGuid=args["--termGuid"])
|
|
2064
|
+
self.params = {
|
|
2065
|
+
**get_api_version_params("datamap"),
|
|
2066
|
+
"limit": args.get("--limit"),
|
|
2067
|
+
"offset": args.get("--offset"),
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
@decorator
|
|
2071
|
+
def glossaryReadRelatedTerms(self, args):
|
|
2072
|
+
"""
|
|
2073
|
+
Retrieve glossary term information.
|
|
2074
|
+
|
|
2075
|
+
Retrieves detailed information about the specified glossary term.
|
|
2076
|
+
Returns complete glossary term metadata and properties.
|
|
2077
|
+
|
|
2078
|
+
Args:
|
|
2079
|
+
args: Dictionary of operation arguments.
|
|
2080
|
+
Contains operation-specific parameters.
|
|
2081
|
+
See method implementation for details.
|
|
2082
|
+
|
|
2083
|
+
Returns:
|
|
2084
|
+
Dictionary containing glossary term information:
|
|
2085
|
+
{
|
|
2086
|
+
'guid': str, # Unique identifier
|
|
2087
|
+
'name': str, # Resource name
|
|
2088
|
+
'attributes': dict, # Resource attributes
|
|
2089
|
+
'status': str, # Resource status
|
|
2090
|
+
'updateTime': int # Last update timestamp
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
Raises:
|
|
2094
|
+
ValueError: When required parameters are missing or invalid:
|
|
2095
|
+
- Empty or None values for required fields
|
|
2096
|
+
- Invalid GUID format
|
|
2097
|
+
- Out-of-range values
|
|
2098
|
+
|
|
2099
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2100
|
+
- DefaultAzureCredential not configured
|
|
2101
|
+
- Insufficient permissions
|
|
2102
|
+
- Expired authentication token
|
|
2103
|
+
|
|
2104
|
+
HTTPError: When Purview API returns error:
|
|
2105
|
+
- 400: Bad request (invalid parameters)
|
|
2106
|
+
- 401: Unauthorized (authentication failed)
|
|
2107
|
+
- 403: Forbidden (insufficient permissions)
|
|
2108
|
+
- 404: Resource not found
|
|
2109
|
+
- 429: Rate limit exceeded
|
|
2110
|
+
- 500: Internal server error
|
|
2111
|
+
|
|
2112
|
+
NetworkError: When network connectivity fails
|
|
2113
|
+
|
|
2114
|
+
Example:
|
|
2115
|
+
# Basic usage
|
|
2116
|
+
client = Glossary()
|
|
2117
|
+
|
|
2118
|
+
result = client.glossaryReadRelatedTerms(args=...)
|
|
2119
|
+
print(f"Result: {result}")
|
|
2120
|
+
|
|
2121
|
+
Use Cases:
|
|
2122
|
+
- Data Discovery: Find and explore data assets
|
|
2123
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2124
|
+
- Reporting: Generate catalog reports
|
|
2125
|
+
"""
|
|
2126
|
+
self.method = "GET"
|
|
2127
|
+
self.endpoint = ENDPOINTS["glossary"]["list_related_terms"].format(termId=args["--termGuid"])
|
|
2128
|
+
self.params = {
|
|
2129
|
+
**get_api_version_params("datamap"),
|
|
2130
|
+
"limit": args.get("--limit"),
|
|
2131
|
+
"offset": args.get("--offset"),
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
@decorator
|
|
2135
|
+
def glossaryReadTermsByGlossary(self, args):
|
|
2136
|
+
"""
|
|
2137
|
+
Retrieve glossary term information.
|
|
2138
|
+
|
|
2139
|
+
Retrieves detailed information about the specified glossary term.
|
|
2140
|
+
Returns complete glossary term metadata and properties.
|
|
2141
|
+
|
|
2142
|
+
Args:
|
|
2143
|
+
args: Dictionary of operation arguments.
|
|
2144
|
+
Contains operation-specific parameters.
|
|
2145
|
+
See method implementation for details.
|
|
2146
|
+
|
|
2147
|
+
Returns:
|
|
2148
|
+
Dictionary containing glossary term information:
|
|
2149
|
+
{
|
|
2150
|
+
'guid': str, # Unique identifier
|
|
2151
|
+
'name': str, # Resource name
|
|
2152
|
+
'attributes': dict, # Resource attributes
|
|
2153
|
+
'status': str, # Resource status
|
|
2154
|
+
'updateTime': int # Last update timestamp
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
Raises:
|
|
2158
|
+
ValueError: When required parameters are missing or invalid:
|
|
2159
|
+
- Empty or None values for required fields
|
|
2160
|
+
- Invalid GUID format
|
|
2161
|
+
- Out-of-range values
|
|
2162
|
+
|
|
2163
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2164
|
+
- DefaultAzureCredential not configured
|
|
2165
|
+
- Insufficient permissions
|
|
2166
|
+
- Expired authentication token
|
|
2167
|
+
|
|
2168
|
+
HTTPError: When Purview API returns error:
|
|
2169
|
+
- 400: Bad request (invalid parameters)
|
|
2170
|
+
- 401: Unauthorized (authentication failed)
|
|
2171
|
+
- 403: Forbidden (insufficient permissions)
|
|
2172
|
+
- 404: Resource not found
|
|
2173
|
+
- 429: Rate limit exceeded
|
|
2174
|
+
- 500: Internal server error
|
|
2175
|
+
|
|
2176
|
+
NetworkError: When network connectivity fails
|
|
2177
|
+
|
|
2178
|
+
Example:
|
|
2179
|
+
# Basic usage
|
|
2180
|
+
client = Glossary()
|
|
2181
|
+
|
|
2182
|
+
result = client.glossaryReadTermsByGlossary(args=...)
|
|
2183
|
+
print(f"Result: {result}")
|
|
2184
|
+
|
|
2185
|
+
Use Cases:
|
|
2186
|
+
- Data Discovery: Find and explore data assets
|
|
2187
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2188
|
+
- Reporting: Generate catalog reports
|
|
2189
|
+
"""
|
|
2190
|
+
self.method = "GET"
|
|
2191
|
+
self.endpoint = ENDPOINTS["glossary"]["list_terms"].format(glossaryId=args["--glossaryGuid"])
|
|
2192
|
+
self.params = {
|
|
2193
|
+
**get_api_version_params("datamap"),
|
|
2194
|
+
"limit": args.get("--limit"),
|
|
2195
|
+
"offset": args.get("--offset"),
|
|
2196
|
+
"sort": args.get("--sort"),
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
@decorator
|
|
2200
|
+
def glossaryReadTermsHeaders(self, args):
|
|
2201
|
+
"""
|
|
2202
|
+
Retrieve glossary term information.
|
|
2203
|
+
|
|
2204
|
+
Retrieves detailed information about the specified glossary term.
|
|
2205
|
+
Returns complete glossary term metadata and properties.
|
|
2206
|
+
|
|
2207
|
+
Args:
|
|
2208
|
+
args: Dictionary of operation arguments.
|
|
2209
|
+
Contains operation-specific parameters.
|
|
2210
|
+
See method implementation for details.
|
|
2211
|
+
|
|
2212
|
+
Returns:
|
|
2213
|
+
Dictionary containing glossary term information:
|
|
2214
|
+
{
|
|
2215
|
+
'guid': str, # Unique identifier
|
|
2216
|
+
'name': str, # Resource name
|
|
2217
|
+
'attributes': dict, # Resource attributes
|
|
2218
|
+
'status': str, # Resource status
|
|
2219
|
+
'updateTime': int # Last update timestamp
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
Raises:
|
|
2223
|
+
ValueError: When required parameters are missing or invalid:
|
|
2224
|
+
- Empty or None values for required fields
|
|
2225
|
+
- Invalid GUID format
|
|
2226
|
+
- Out-of-range values
|
|
2227
|
+
|
|
2228
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2229
|
+
- DefaultAzureCredential not configured
|
|
2230
|
+
- Insufficient permissions
|
|
2231
|
+
- Expired authentication token
|
|
2232
|
+
|
|
2233
|
+
HTTPError: When Purview API returns error:
|
|
2234
|
+
- 400: Bad request (invalid parameters)
|
|
2235
|
+
- 401: Unauthorized (authentication failed)
|
|
2236
|
+
- 403: Forbidden (insufficient permissions)
|
|
2237
|
+
- 404: Resource not found
|
|
2238
|
+
- 429: Rate limit exceeded
|
|
2239
|
+
- 500: Internal server error
|
|
2240
|
+
|
|
2241
|
+
NetworkError: When network connectivity fails
|
|
2242
|
+
|
|
2243
|
+
Example:
|
|
2244
|
+
# Basic usage
|
|
2245
|
+
client = Glossary()
|
|
2246
|
+
|
|
2247
|
+
result = client.glossaryReadTermsHeaders(args=...)
|
|
2248
|
+
print(f"Result: {result}")
|
|
2249
|
+
|
|
2250
|
+
Use Cases:
|
|
2251
|
+
- Data Discovery: Find and explore data assets
|
|
2252
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2253
|
+
- Reporting: Generate catalog reports
|
|
2254
|
+
"""
|
|
2255
|
+
self.method = "GET"
|
|
2256
|
+
self.endpoint = ENDPOINTS["glossary"]["terms_headers"].format(glossaryGuid=args["--glossaryGuid"])
|
|
2257
|
+
self.params = {
|
|
2258
|
+
**get_api_version_params("datamap"),
|
|
2259
|
+
"limit": args.get("--limit"),
|
|
2260
|
+
"offset": args.get("--offset"),
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
# === IMPORT/EXPORT OPERATIONS ===
|
|
2264
|
+
|
|
2265
|
+
@decorator
|
|
2266
|
+
def glossaryExportTerms(self, args):
|
|
2267
|
+
"""
|
|
2268
|
+
Perform batch operation on resources.
|
|
2269
|
+
|
|
2270
|
+
Processes multiple resources in a single operation.
|
|
2271
|
+
More efficient than individual operations for bulk data.
|
|
2272
|
+
|
|
2273
|
+
Args:
|
|
2274
|
+
args: Dictionary of operation arguments.
|
|
2275
|
+
Contains operation-specific parameters.
|
|
2276
|
+
See method implementation for details.
|
|
2277
|
+
|
|
2278
|
+
Returns:
|
|
2279
|
+
Dictionary with batch operation results:
|
|
2280
|
+
{
|
|
2281
|
+
'succeeded': int, # Success count
|
|
2282
|
+
'failed': int, # Failure count
|
|
2283
|
+
'results': [...], # Per-item results
|
|
2284
|
+
'errors': [...] # Error details
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
Raises:
|
|
2288
|
+
ValueError: When required parameters are missing or invalid:
|
|
2289
|
+
- Empty or None values for required fields
|
|
2290
|
+
- Invalid GUID format
|
|
2291
|
+
- Out-of-range values
|
|
2292
|
+
|
|
2293
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2294
|
+
- DefaultAzureCredential not configured
|
|
2295
|
+
- Insufficient permissions
|
|
2296
|
+
- Expired authentication token
|
|
2297
|
+
|
|
2298
|
+
HTTPError: When Purview API returns error:
|
|
2299
|
+
- 400: Bad request (invalid parameters)
|
|
2300
|
+
- 401: Unauthorized (authentication failed)
|
|
2301
|
+
- 403: Forbidden (insufficient permissions)
|
|
2302
|
+
- 404: Resource not found
|
|
2303
|
+
- 429: Rate limit exceeded
|
|
2304
|
+
- 500: Internal server error
|
|
2305
|
+
|
|
2306
|
+
NetworkError: When network connectivity fails
|
|
2307
|
+
|
|
2308
|
+
Example:
|
|
2309
|
+
# Basic usage
|
|
2310
|
+
client = Glossary()
|
|
2311
|
+
|
|
2312
|
+
result = client.glossaryExportTerms(args=...)
|
|
2313
|
+
print(f"Result: {result}")
|
|
2314
|
+
|
|
2315
|
+
Use Cases:
|
|
2316
|
+
- Bulk Import: Load large volumes of metadata
|
|
2317
|
+
- Migration: Transfer catalog from other systems
|
|
2318
|
+
- Mass Updates: Apply changes to many resources
|
|
2319
|
+
"""
|
|
2320
|
+
self.method = "POST"
|
|
2321
|
+
self.endpoint = ENDPOINTS["glossary"]["terms_export"].format(glossaryGuid=args["--glossaryGuid"])
|
|
2322
|
+
self.params = {
|
|
2323
|
+
**get_api_version_params("datamap"),
|
|
2324
|
+
"termGuids": args.get("--termGuids"),
|
|
2325
|
+
"includeTermHierarchy": str(args.get("--includeTermHierarchy", False)).lower(),
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
@decorator
|
|
2329
|
+
def glossaryImportTerms(self, args):
|
|
2330
|
+
"""
|
|
2331
|
+
Perform batch operation on resources.
|
|
2332
|
+
|
|
2333
|
+
Processes multiple resources in a single operation.
|
|
2334
|
+
More efficient than individual operations for bulk data.
|
|
2335
|
+
|
|
2336
|
+
Args:
|
|
2337
|
+
args: Dictionary of operation arguments.
|
|
2338
|
+
Contains operation-specific parameters.
|
|
2339
|
+
See method implementation for details.
|
|
2340
|
+
|
|
2341
|
+
Returns:
|
|
2342
|
+
Dictionary with batch operation results:
|
|
2343
|
+
{
|
|
2344
|
+
'succeeded': int, # Success count
|
|
2345
|
+
'failed': int, # Failure count
|
|
2346
|
+
'results': [...], # Per-item results
|
|
2347
|
+
'errors': [...] # Error details
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
Raises:
|
|
2351
|
+
ValueError: When required parameters are missing or invalid:
|
|
2352
|
+
- Empty or None values for required fields
|
|
2353
|
+
- Invalid GUID format
|
|
2354
|
+
- Out-of-range values
|
|
2355
|
+
|
|
2356
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2357
|
+
- DefaultAzureCredential not configured
|
|
2358
|
+
- Insufficient permissions
|
|
2359
|
+
- Expired authentication token
|
|
2360
|
+
|
|
2361
|
+
HTTPError: When Purview API returns error:
|
|
2362
|
+
- 400: Bad request (invalid parameters)
|
|
2363
|
+
- 401: Unauthorized (authentication failed)
|
|
2364
|
+
- 403: Forbidden (insufficient permissions)
|
|
2365
|
+
- 404: Resource not found
|
|
2366
|
+
- 429: Rate limit exceeded
|
|
2367
|
+
- 500: Internal server error
|
|
2368
|
+
|
|
2369
|
+
NetworkError: When network connectivity fails
|
|
2370
|
+
|
|
2371
|
+
Example:
|
|
2372
|
+
# Basic usage
|
|
2373
|
+
client = Glossary()
|
|
2374
|
+
|
|
2375
|
+
result = client.glossaryImportTerms(args=...)
|
|
2376
|
+
print(f"Result: {result}")
|
|
2377
|
+
|
|
2378
|
+
Use Cases:
|
|
2379
|
+
- Bulk Import: Load large volumes of metadata
|
|
2380
|
+
- Migration: Transfer catalog from other systems
|
|
2381
|
+
- Mass Updates: Apply changes to many resources
|
|
2382
|
+
"""
|
|
2383
|
+
self.method = "POST"
|
|
2384
|
+
self.endpoint = ENDPOINTS["glossary"]["terms_import"].format(glossaryGuid=args["--glossaryGuid"])
|
|
2385
|
+
self.params = get_api_version_params("datamap")
|
|
2386
|
+
self.payload = get_json(args, "--payloadFile")
|
|
2387
|
+
|
|
2388
|
+
@decorator
|
|
2389
|
+
def glossaryImportTermsByName(self, args):
|
|
2390
|
+
"""
|
|
2391
|
+
Perform batch operation on resources.
|
|
2392
|
+
|
|
2393
|
+
Processes multiple resources in a single operation.
|
|
2394
|
+
More efficient than individual operations for bulk data.
|
|
2395
|
+
|
|
2396
|
+
Args:
|
|
2397
|
+
args: Dictionary of operation arguments.
|
|
2398
|
+
Contains operation-specific parameters.
|
|
2399
|
+
See method implementation for details.
|
|
2400
|
+
|
|
2401
|
+
Returns:
|
|
2402
|
+
Dictionary with batch operation results:
|
|
2403
|
+
{
|
|
2404
|
+
'succeeded': int, # Success count
|
|
2405
|
+
'failed': int, # Failure count
|
|
2406
|
+
'results': [...], # Per-item results
|
|
2407
|
+
'errors': [...] # Error details
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
Raises:
|
|
2411
|
+
ValueError: When required parameters are missing or invalid:
|
|
2412
|
+
- Empty or None values for required fields
|
|
2413
|
+
- Invalid GUID format
|
|
2414
|
+
- Out-of-range values
|
|
2415
|
+
|
|
2416
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2417
|
+
- DefaultAzureCredential not configured
|
|
2418
|
+
- Insufficient permissions
|
|
2419
|
+
- Expired authentication token
|
|
2420
|
+
|
|
2421
|
+
HTTPError: When Purview API returns error:
|
|
2422
|
+
- 400: Bad request (invalid parameters)
|
|
2423
|
+
- 401: Unauthorized (authentication failed)
|
|
2424
|
+
- 403: Forbidden (insufficient permissions)
|
|
2425
|
+
- 404: Resource not found
|
|
2426
|
+
- 429: Rate limit exceeded
|
|
2427
|
+
- 500: Internal server error
|
|
2428
|
+
|
|
2429
|
+
NetworkError: When network connectivity fails
|
|
2430
|
+
|
|
2431
|
+
Example:
|
|
2432
|
+
# Basic usage
|
|
2433
|
+
client = Glossary()
|
|
2434
|
+
|
|
2435
|
+
result = client.glossaryImportTermsByName(args=...)
|
|
2436
|
+
print(f"Result: {result}")
|
|
2437
|
+
|
|
2438
|
+
Use Cases:
|
|
2439
|
+
- Bulk Import: Load large volumes of metadata
|
|
2440
|
+
- Migration: Transfer catalog from other systems
|
|
2441
|
+
- Mass Updates: Apply changes to many resources
|
|
2442
|
+
"""
|
|
2443
|
+
self.method = "POST"
|
|
2444
|
+
self.endpoint = ENDPOINTS["glossary"]["terms_import_by_name"].format(glossaryName=args["--glossaryName"])
|
|
2445
|
+
self.params = get_api_version_params("datamap")
|
|
2446
|
+
self.payload = get_json(args, "--payloadFile")
|
|
2447
|
+
|
|
2448
|
+
@decorator
|
|
2449
|
+
def glossaryReadImportOperation(self, args):
|
|
2450
|
+
"""
|
|
2451
|
+
Retrieve glossary information.
|
|
2452
|
+
|
|
2453
|
+
Retrieves detailed information about the specified glossary.
|
|
2454
|
+
Returns complete glossary metadata and properties.
|
|
2455
|
+
|
|
2456
|
+
Args:
|
|
2457
|
+
args: Dictionary of operation arguments.
|
|
2458
|
+
Contains operation-specific parameters.
|
|
2459
|
+
See method implementation for details.
|
|
2460
|
+
|
|
2461
|
+
Returns:
|
|
2462
|
+
Dictionary containing glossary information:
|
|
2463
|
+
{
|
|
2464
|
+
'guid': str, # Unique identifier
|
|
2465
|
+
'name': str, # Resource name
|
|
2466
|
+
'attributes': dict, # Resource attributes
|
|
2467
|
+
'status': str, # Resource status
|
|
2468
|
+
'updateTime': int # Last update timestamp
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
Raises:
|
|
2472
|
+
ValueError: When required parameters are missing or invalid:
|
|
2473
|
+
- Empty or None values for required fields
|
|
2474
|
+
- Invalid GUID format
|
|
2475
|
+
- Out-of-range values
|
|
2476
|
+
|
|
2477
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2478
|
+
- DefaultAzureCredential not configured
|
|
2479
|
+
- Insufficient permissions
|
|
2480
|
+
- Expired authentication token
|
|
2481
|
+
|
|
2482
|
+
HTTPError: When Purview API returns error:
|
|
2483
|
+
- 400: Bad request (invalid parameters)
|
|
2484
|
+
- 401: Unauthorized (authentication failed)
|
|
2485
|
+
- 403: Forbidden (insufficient permissions)
|
|
2486
|
+
- 404: Resource not found
|
|
2487
|
+
- 429: Rate limit exceeded
|
|
2488
|
+
- 500: Internal server error
|
|
2489
|
+
|
|
2490
|
+
NetworkError: When network connectivity fails
|
|
2491
|
+
|
|
2492
|
+
Example:
|
|
2493
|
+
# Basic usage
|
|
2494
|
+
client = Glossary()
|
|
2495
|
+
|
|
2496
|
+
result = client.glossaryReadImportOperation(args=...)
|
|
2497
|
+
print(f"Result: {result}")
|
|
2498
|
+
|
|
2499
|
+
Use Cases:
|
|
2500
|
+
- Data Discovery: Find and explore data assets
|
|
2501
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2502
|
+
- Reporting: Generate catalog reports
|
|
2503
|
+
"""
|
|
2504
|
+
self.method = "GET"
|
|
2505
|
+
self.endpoint = ENDPOINTS["glossary"]["terms_import_operation"].format(operationGuid=args["--operationGuid"])
|
|
2506
|
+
self.params = get_api_version_params("datamap")
|
|
2507
|
+
|
|
2508
|
+
# === ADVANCED GLOSSARY OPERATIONS (NEW FOR 100% COVERAGE) ===
|
|
2509
|
+
|
|
2510
|
+
@decorator
|
|
2511
|
+
def glossaryReadAnalytics(self, args):
|
|
2512
|
+
"""
|
|
2513
|
+
Retrieve glossary information.
|
|
2514
|
+
|
|
2515
|
+
Retrieves detailed information about the specified glossary.
|
|
2516
|
+
Returns complete glossary metadata and properties.
|
|
2517
|
+
|
|
2518
|
+
Args:
|
|
2519
|
+
args: Dictionary of operation arguments.
|
|
2520
|
+
Contains operation-specific parameters.
|
|
2521
|
+
See method implementation for details.
|
|
2522
|
+
|
|
2523
|
+
Returns:
|
|
2524
|
+
Dictionary containing glossary information:
|
|
2525
|
+
{
|
|
2526
|
+
'guid': str, # Unique identifier
|
|
2527
|
+
'name': str, # Resource name
|
|
2528
|
+
'attributes': dict, # Resource attributes
|
|
2529
|
+
'status': str, # Resource status
|
|
2530
|
+
'updateTime': int # Last update timestamp
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
Raises:
|
|
2534
|
+
ValueError: When required parameters are missing or invalid:
|
|
2535
|
+
- Empty or None values for required fields
|
|
2536
|
+
- Invalid GUID format
|
|
2537
|
+
- Out-of-range values
|
|
2538
|
+
|
|
2539
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2540
|
+
- DefaultAzureCredential not configured
|
|
2541
|
+
- Insufficient permissions
|
|
2542
|
+
- Expired authentication token
|
|
2543
|
+
|
|
2544
|
+
HTTPError: When Purview API returns error:
|
|
2545
|
+
- 400: Bad request (invalid parameters)
|
|
2546
|
+
- 401: Unauthorized (authentication failed)
|
|
2547
|
+
- 403: Forbidden (insufficient permissions)
|
|
2548
|
+
- 404: Resource not found
|
|
2549
|
+
- 429: Rate limit exceeded
|
|
2550
|
+
- 500: Internal server error
|
|
2551
|
+
|
|
2552
|
+
NetworkError: When network connectivity fails
|
|
2553
|
+
|
|
2554
|
+
Example:
|
|
2555
|
+
# Basic usage
|
|
2556
|
+
client = Glossary()
|
|
2557
|
+
|
|
2558
|
+
result = client.glossaryReadAnalytics(args=...)
|
|
2559
|
+
print(f"Result: {result}")
|
|
2560
|
+
|
|
2561
|
+
Use Cases:
|
|
2562
|
+
- Data Discovery: Find and explore data assets
|
|
2563
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2564
|
+
- Reporting: Generate catalog reports
|
|
2565
|
+
"""
|
|
2566
|
+
self.method = "GET"
|
|
2567
|
+
self.endpoint = ENDPOINTS["glossary"]["glossary_analytics"].format(glossaryId=args["--glossaryGuid"])
|
|
2568
|
+
self.params = {
|
|
2569
|
+
**get_api_version_params("datamap"),
|
|
2570
|
+
"startTime": args.get("--startTime"),
|
|
2571
|
+
"endTime": args.get("--endTime"),
|
|
2572
|
+
"metrics": args.get("--metrics", "all")
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
@decorator
|
|
2576
|
+
def glossaryReadTermUsageStatistics(self, args):
|
|
2577
|
+
"""
|
|
2578
|
+
Retrieve glossary term information.
|
|
2579
|
+
|
|
2580
|
+
Retrieves detailed information about the specified glossary term.
|
|
2581
|
+
Returns complete glossary term metadata and properties.
|
|
2582
|
+
|
|
2583
|
+
Args:
|
|
2584
|
+
args: Dictionary of operation arguments.
|
|
2585
|
+
Contains operation-specific parameters.
|
|
2586
|
+
See method implementation for details.
|
|
2587
|
+
|
|
2588
|
+
Returns:
|
|
2589
|
+
Dictionary containing glossary term information:
|
|
2590
|
+
{
|
|
2591
|
+
'guid': str, # Unique identifier
|
|
2592
|
+
'name': str, # Resource name
|
|
2593
|
+
'attributes': dict, # Resource attributes
|
|
2594
|
+
'status': str, # Resource status
|
|
2595
|
+
'updateTime': int # Last update timestamp
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
Raises:
|
|
2599
|
+
ValueError: When required parameters are missing or invalid:
|
|
2600
|
+
- Empty or None values for required fields
|
|
2601
|
+
- Invalid GUID format
|
|
2602
|
+
- Out-of-range values
|
|
2603
|
+
|
|
2604
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2605
|
+
- DefaultAzureCredential not configured
|
|
2606
|
+
- Insufficient permissions
|
|
2607
|
+
- Expired authentication token
|
|
2608
|
+
|
|
2609
|
+
HTTPError: When Purview API returns error:
|
|
2610
|
+
- 400: Bad request (invalid parameters)
|
|
2611
|
+
- 401: Unauthorized (authentication failed)
|
|
2612
|
+
- 403: Forbidden (insufficient permissions)
|
|
2613
|
+
- 404: Resource not found
|
|
2614
|
+
- 429: Rate limit exceeded
|
|
2615
|
+
- 500: Internal server error
|
|
2616
|
+
|
|
2617
|
+
NetworkError: When network connectivity fails
|
|
2618
|
+
|
|
2619
|
+
Example:
|
|
2620
|
+
# Basic usage
|
|
2621
|
+
client = Glossary()
|
|
2622
|
+
|
|
2623
|
+
result = client.glossaryReadTermUsageStatistics(args=...)
|
|
2624
|
+
print(f"Result: {result}")
|
|
2625
|
+
|
|
2626
|
+
Use Cases:
|
|
2627
|
+
- Data Discovery: Find and explore data assets
|
|
2628
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2629
|
+
- Reporting: Generate catalog reports
|
|
2630
|
+
"""
|
|
2631
|
+
self.method = "GET"
|
|
2632
|
+
self.endpoint = ENDPOINTS["glossary"]["term_usage_statistics"].format(termId=args["--termGuid"])
|
|
2633
|
+
self.params = {
|
|
2634
|
+
**get_api_version_params("datamap"),
|
|
2635
|
+
"startTime": args.get("--startTime"),
|
|
2636
|
+
"endTime": args.get("--endTime"),
|
|
2637
|
+
"aggregation": args.get("--aggregation", "daily")
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
@decorator
|
|
2641
|
+
def glossaryReadApprovalWorkflow(self, args):
|
|
2642
|
+
"""
|
|
2643
|
+
Retrieve glossary information.
|
|
2644
|
+
|
|
2645
|
+
Retrieves detailed information about the specified glossary.
|
|
2646
|
+
Returns complete glossary metadata and properties.
|
|
2647
|
+
|
|
2648
|
+
Args:
|
|
2649
|
+
args: Dictionary of operation arguments.
|
|
2650
|
+
Contains operation-specific parameters.
|
|
2651
|
+
See method implementation for details.
|
|
2652
|
+
|
|
2653
|
+
Returns:
|
|
2654
|
+
Dictionary containing glossary information:
|
|
2655
|
+
{
|
|
2656
|
+
'guid': str, # Unique identifier
|
|
2657
|
+
'name': str, # Resource name
|
|
2658
|
+
'attributes': dict, # Resource attributes
|
|
2659
|
+
'status': str, # Resource status
|
|
2660
|
+
'updateTime': int # Last update timestamp
|
|
2661
|
+
}
|
|
2662
|
+
|
|
2663
|
+
Raises:
|
|
2664
|
+
ValueError: When required parameters are missing or invalid:
|
|
2665
|
+
- Empty or None values for required fields
|
|
2666
|
+
- Invalid GUID format
|
|
2667
|
+
- Out-of-range values
|
|
2668
|
+
|
|
2669
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2670
|
+
- DefaultAzureCredential not configured
|
|
2671
|
+
- Insufficient permissions
|
|
2672
|
+
- Expired authentication token
|
|
2673
|
+
|
|
2674
|
+
HTTPError: When Purview API returns error:
|
|
2675
|
+
- 400: Bad request (invalid parameters)
|
|
2676
|
+
- 401: Unauthorized (authentication failed)
|
|
2677
|
+
- 403: Forbidden (insufficient permissions)
|
|
2678
|
+
- 404: Resource not found
|
|
2679
|
+
- 429: Rate limit exceeded
|
|
2680
|
+
- 500: Internal server error
|
|
2681
|
+
|
|
2682
|
+
NetworkError: When network connectivity fails
|
|
2683
|
+
|
|
2684
|
+
Example:
|
|
2685
|
+
# Basic usage
|
|
2686
|
+
client = Glossary()
|
|
2687
|
+
|
|
2688
|
+
result = client.glossaryReadApprovalWorkflow(args=...)
|
|
2689
|
+
print(f"Result: {result}")
|
|
2690
|
+
|
|
2691
|
+
Use Cases:
|
|
2692
|
+
- Data Discovery: Find and explore data assets
|
|
2693
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2694
|
+
- Reporting: Generate catalog reports
|
|
2695
|
+
"""
|
|
2696
|
+
self.method = "GET"
|
|
2697
|
+
self.endpoint = ENDPOINTS["glossary"]["glossary_approval_workflow"].format(glossaryId=args["--glossaryGuid"])
|
|
2698
|
+
self.params = get_api_version_params("datamap")
|
|
2699
|
+
|
|
2700
|
+
@decorator
|
|
2701
|
+
def glossaryCreateApprovalWorkflow(self, args):
|
|
2702
|
+
"""
|
|
2703
|
+
Create a new glossary.
|
|
2704
|
+
|
|
2705
|
+
Creates a new glossary in Microsoft Purview.
|
|
2706
|
+
Requires appropriate permissions and valid glossary definition.
|
|
2707
|
+
|
|
2708
|
+
Args:
|
|
2709
|
+
args: Dictionary of operation arguments.
|
|
2710
|
+
Contains operation-specific parameters.
|
|
2711
|
+
See method implementation for details.
|
|
2712
|
+
|
|
2713
|
+
Returns:
|
|
2714
|
+
Dictionary containing created glossary:
|
|
2715
|
+
{
|
|
2716
|
+
'guid': str, # Unique identifier
|
|
2717
|
+
'name': str, # Resource name
|
|
2718
|
+
'status': str, # Creation status
|
|
2719
|
+
'attributes': dict, # Resource attributes
|
|
2720
|
+
'createTime': int # Creation timestamp
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
Raises:
|
|
2724
|
+
ValueError: When required parameters are missing or invalid:
|
|
2725
|
+
- Empty or None values for required fields
|
|
2726
|
+
- Invalid GUID format
|
|
2727
|
+
- Out-of-range values
|
|
2728
|
+
|
|
2729
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2730
|
+
- DefaultAzureCredential not configured
|
|
2731
|
+
- Insufficient permissions
|
|
2732
|
+
- Expired authentication token
|
|
2733
|
+
|
|
2734
|
+
HTTPError: When Purview API returns error:
|
|
2735
|
+
- 400: Bad request (invalid parameters)
|
|
2736
|
+
- 401: Unauthorized (authentication failed)
|
|
2737
|
+
- 403: Forbidden (insufficient permissions)
|
|
2738
|
+
- 404: Resource not found
|
|
2739
|
+
- 409: Conflict (resource already exists)
|
|
2740
|
+
- 429: Rate limit exceeded
|
|
2741
|
+
- 500: Internal server error
|
|
2742
|
+
|
|
2743
|
+
NetworkError: When network connectivity fails
|
|
2744
|
+
|
|
2745
|
+
Example:
|
|
2746
|
+
# Basic usage
|
|
2747
|
+
client = Glossary()
|
|
2748
|
+
|
|
2749
|
+
result = client.glossaryCreateApprovalWorkflow(args=...)
|
|
2750
|
+
print(f"Result: {result}")
|
|
2751
|
+
|
|
2752
|
+
# With detailed data
|
|
2753
|
+
data = {
|
|
2754
|
+
'name': 'My Resource',
|
|
2755
|
+
'description': 'Resource description',
|
|
2756
|
+
'attributes': {
|
|
2757
|
+
'key1': 'value1',
|
|
2758
|
+
'key2': 'value2'
|
|
2759
|
+
}
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
result = client.glossaryCreateApprovalWorkflow(data)
|
|
2763
|
+
print(f"Created/Updated: {result['guid']}")
|
|
2764
|
+
|
|
2765
|
+
Use Cases:
|
|
2766
|
+
- Data Onboarding: Register new data sources in catalog
|
|
2767
|
+
- Metadata Management: Add descriptive metadata to assets
|
|
2768
|
+
- Automation: Programmatically populate catalog
|
|
2769
|
+
"""
|
|
2770
|
+
self.method = "POST"
|
|
2771
|
+
self.endpoint = ENDPOINTS["glossary"]["glossary_approval_workflow"].format(glossaryId=args["--glossaryGuid"])
|
|
2772
|
+
self.params = get_api_version_params("datamap")
|
|
2773
|
+
self.payload = get_json(args, "--payloadFile")
|
|
2774
|
+
|
|
2775
|
+
@decorator
|
|
2776
|
+
def glossaryValidateTerm(self, args):
|
|
2777
|
+
"""
|
|
2778
|
+
Perform operation on resource.
|
|
2779
|
+
|
|
2780
|
+
|
|
2781
|
+
|
|
2782
|
+
Args:
|
|
2783
|
+
args: Dictionary of operation arguments.
|
|
2784
|
+
Contains operation-specific parameters.
|
|
2785
|
+
See method implementation for details.
|
|
2786
|
+
|
|
2787
|
+
Returns:
|
|
2788
|
+
[TODO: Specify return type and structure]
|
|
2789
|
+
[TODO: Document nested fields]
|
|
2790
|
+
|
|
2791
|
+
Raises:
|
|
2792
|
+
ValueError: When required parameters are missing or invalid:
|
|
2793
|
+
- Empty or None values for required fields
|
|
2794
|
+
- Invalid GUID format
|
|
2795
|
+
- Out-of-range values
|
|
2796
|
+
|
|
2797
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2798
|
+
- DefaultAzureCredential not configured
|
|
2799
|
+
- Insufficient permissions
|
|
2800
|
+
- Expired authentication token
|
|
2801
|
+
|
|
2802
|
+
HTTPError: When Purview API returns error:
|
|
2803
|
+
- 400: Bad request (invalid parameters)
|
|
2804
|
+
- 401: Unauthorized (authentication failed)
|
|
2805
|
+
- 403: Forbidden (insufficient permissions)
|
|
2806
|
+
- 404: Resource not found
|
|
2807
|
+
- 429: Rate limit exceeded
|
|
2808
|
+
- 500: Internal server error
|
|
2809
|
+
|
|
2810
|
+
NetworkError: When network connectivity fails
|
|
2811
|
+
|
|
2812
|
+
Example:
|
|
2813
|
+
# Basic usage
|
|
2814
|
+
client = Glossary()
|
|
2815
|
+
|
|
2816
|
+
result = client.glossaryValidateTerm(args=...)
|
|
2817
|
+
print(f"Result: {result}")
|
|
2818
|
+
|
|
2819
|
+
Use Cases:
|
|
2820
|
+
- [TODO: Add specific use cases for this operation]
|
|
2821
|
+
- [TODO: Include business context]
|
|
2822
|
+
- [TODO: Explain when to use this method]
|
|
2823
|
+
"""
|
|
2824
|
+
self.method = "POST"
|
|
2825
|
+
self.endpoint = ENDPOINTS["glossary"]["term_validation"]
|
|
2826
|
+
self.params = get_api_version_params("datamap")
|
|
2827
|
+
self.payload = get_json(args, "--payloadFile")
|
|
2828
|
+
|
|
2829
|
+
@decorator
|
|
2830
|
+
def glossaryReadTemplates(self, args):
|
|
2831
|
+
"""
|
|
2832
|
+
Retrieve glossary information.
|
|
2833
|
+
|
|
2834
|
+
Retrieves detailed information about the specified glossary.
|
|
2835
|
+
Returns complete glossary metadata and properties.
|
|
2836
|
+
|
|
2837
|
+
Args:
|
|
2838
|
+
args: Dictionary of operation arguments.
|
|
2839
|
+
Contains operation-specific parameters.
|
|
2840
|
+
See method implementation for details.
|
|
2841
|
+
|
|
2842
|
+
Returns:
|
|
2843
|
+
Dictionary containing glossary information:
|
|
2844
|
+
{
|
|
2845
|
+
'guid': str, # Unique identifier
|
|
2846
|
+
'name': str, # Resource name
|
|
2847
|
+
'attributes': dict, # Resource attributes
|
|
2848
|
+
'status': str, # Resource status
|
|
2849
|
+
'updateTime': int # Last update timestamp
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
Raises:
|
|
2853
|
+
ValueError: When required parameters are missing or invalid:
|
|
2854
|
+
- Empty or None values for required fields
|
|
2855
|
+
- Invalid GUID format
|
|
2856
|
+
- Out-of-range values
|
|
2857
|
+
|
|
2858
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2859
|
+
- DefaultAzureCredential not configured
|
|
2860
|
+
- Insufficient permissions
|
|
2861
|
+
- Expired authentication token
|
|
2862
|
+
|
|
2863
|
+
HTTPError: When Purview API returns error:
|
|
2864
|
+
- 400: Bad request (invalid parameters)
|
|
2865
|
+
- 401: Unauthorized (authentication failed)
|
|
2866
|
+
- 403: Forbidden (insufficient permissions)
|
|
2867
|
+
- 404: Resource not found
|
|
2868
|
+
- 429: Rate limit exceeded
|
|
2869
|
+
- 500: Internal server error
|
|
2870
|
+
|
|
2871
|
+
NetworkError: When network connectivity fails
|
|
2872
|
+
|
|
2873
|
+
Example:
|
|
2874
|
+
# Basic usage
|
|
2875
|
+
client = Glossary()
|
|
2876
|
+
|
|
2877
|
+
result = client.glossaryReadTemplates(args=...)
|
|
2878
|
+
print(f"Result: {result}")
|
|
2879
|
+
|
|
2880
|
+
Use Cases:
|
|
2881
|
+
- Data Discovery: Find and explore data assets
|
|
2882
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2883
|
+
- Reporting: Generate catalog reports
|
|
2884
|
+
"""
|
|
2885
|
+
self.method = "GET"
|
|
2886
|
+
self.endpoint = ENDPOINTS["glossary"]["glossary_templates"]
|
|
2887
|
+
self.params = {
|
|
2888
|
+
**get_api_version_params("datamap"),
|
|
2889
|
+
"templateType": args.get("--templateType"),
|
|
2890
|
+
"domain": args.get("--domain")
|
|
2891
|
+
}
|
|
2892
|
+
|
|
2893
|
+
@decorator
|
|
2894
|
+
def glossaryReadTermTemplates(self, args):
|
|
2895
|
+
"""
|
|
2896
|
+
Retrieve glossary term information.
|
|
2897
|
+
|
|
2898
|
+
Retrieves detailed information about the specified glossary term.
|
|
2899
|
+
Returns complete glossary term metadata and properties.
|
|
2900
|
+
|
|
2901
|
+
Args:
|
|
2902
|
+
args: Dictionary of operation arguments.
|
|
2903
|
+
Contains operation-specific parameters.
|
|
2904
|
+
See method implementation for details.
|
|
2905
|
+
|
|
2906
|
+
Returns:
|
|
2907
|
+
Dictionary containing glossary term information:
|
|
2908
|
+
{
|
|
2909
|
+
'guid': str, # Unique identifier
|
|
2910
|
+
'name': str, # Resource name
|
|
2911
|
+
'attributes': dict, # Resource attributes
|
|
2912
|
+
'status': str, # Resource status
|
|
2913
|
+
'updateTime': int # Last update timestamp
|
|
2914
|
+
}
|
|
2915
|
+
|
|
2916
|
+
Raises:
|
|
2917
|
+
ValueError: When required parameters are missing or invalid:
|
|
2918
|
+
- Empty or None values for required fields
|
|
2919
|
+
- Invalid GUID format
|
|
2920
|
+
- Out-of-range values
|
|
2921
|
+
|
|
2922
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2923
|
+
- DefaultAzureCredential not configured
|
|
2924
|
+
- Insufficient permissions
|
|
2925
|
+
- Expired authentication token
|
|
2926
|
+
|
|
2927
|
+
HTTPError: When Purview API returns error:
|
|
2928
|
+
- 400: Bad request (invalid parameters)
|
|
2929
|
+
- 401: Unauthorized (authentication failed)
|
|
2930
|
+
- 403: Forbidden (insufficient permissions)
|
|
2931
|
+
- 404: Resource not found
|
|
2932
|
+
- 429: Rate limit exceeded
|
|
2933
|
+
- 500: Internal server error
|
|
2934
|
+
|
|
2935
|
+
NetworkError: When network connectivity fails
|
|
2936
|
+
|
|
2937
|
+
Example:
|
|
2938
|
+
# Basic usage
|
|
2939
|
+
client = Glossary()
|
|
2940
|
+
|
|
2941
|
+
result = client.glossaryReadTermTemplates(args=...)
|
|
2942
|
+
print(f"Result: {result}")
|
|
2943
|
+
|
|
2944
|
+
Use Cases:
|
|
2945
|
+
- Data Discovery: Find and explore data assets
|
|
2946
|
+
- Compliance Auditing: Review metadata and classifications
|
|
2947
|
+
- Reporting: Generate catalog reports
|
|
2948
|
+
"""
|
|
2949
|
+
self.method = "GET"
|
|
2950
|
+
self.endpoint = ENDPOINTS["glossary"]["term_templates"]
|
|
2951
|
+
self.params = {
|
|
2952
|
+
**get_api_version_params("datamap"),
|
|
2953
|
+
"templateType": args.get("--templateType"),
|
|
2954
|
+
"domain": args.get("--domain")
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2957
|
+
# === LEGACY COMPATIBILITY METHODS ===
|
|
2958
|
+
|
|
2959
|
+
@decorator
|
|
2960
|
+
def glossaryPutCategory(self, args):
|
|
2961
|
+
"""
|
|
2962
|
+
Update an existing glossary category.
|
|
2963
|
+
|
|
2964
|
+
Updates an existing glossary category with new values.
|
|
2965
|
+
Only specified fields are modified; others remain unchanged.
|
|
2966
|
+
|
|
2967
|
+
Args:
|
|
2968
|
+
args: Dictionary of operation arguments.
|
|
2969
|
+
Contains operation-specific parameters.
|
|
2970
|
+
See method implementation for details.
|
|
2971
|
+
|
|
2972
|
+
Returns:
|
|
2973
|
+
Dictionary containing updated glossary category:
|
|
2974
|
+
{
|
|
2975
|
+
'guid': str, # Unique identifier
|
|
2976
|
+
'attributes': dict, # Updated attributes
|
|
2977
|
+
'updateTime': int # Update timestamp
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
Raises:
|
|
2981
|
+
ValueError: When required parameters are missing or invalid:
|
|
2982
|
+
- Empty or None values for required fields
|
|
2983
|
+
- Invalid GUID format
|
|
2984
|
+
- Out-of-range values
|
|
2985
|
+
|
|
2986
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
2987
|
+
- DefaultAzureCredential not configured
|
|
2988
|
+
- Insufficient permissions
|
|
2989
|
+
- Expired authentication token
|
|
2990
|
+
|
|
2991
|
+
HTTPError: When Purview API returns error:
|
|
2992
|
+
- 400: Bad request (invalid parameters)
|
|
2993
|
+
- 401: Unauthorized (authentication failed)
|
|
2994
|
+
- 403: Forbidden (insufficient permissions)
|
|
2995
|
+
- 404: Resource not found
|
|
2996
|
+
- 429: Rate limit exceeded
|
|
2997
|
+
- 500: Internal server error
|
|
2998
|
+
|
|
2999
|
+
NetworkError: When network connectivity fails
|
|
3000
|
+
|
|
3001
|
+
Example:
|
|
3002
|
+
# Basic usage
|
|
3003
|
+
client = Glossary()
|
|
3004
|
+
|
|
3005
|
+
result = client.glossaryPutCategory(args=...)
|
|
3006
|
+
print(f"Result: {result}")
|
|
3007
|
+
|
|
3008
|
+
# With detailed data
|
|
3009
|
+
data = {
|
|
3010
|
+
'name': 'My Resource',
|
|
3011
|
+
'description': 'Resource description',
|
|
3012
|
+
'attributes': {
|
|
3013
|
+
'key1': 'value1',
|
|
3014
|
+
'key2': 'value2'
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
result = client.glossaryPutCategory(data)
|
|
3019
|
+
print(f"Created/Updated: {result['guid']}")
|
|
3020
|
+
|
|
3021
|
+
Use Cases:
|
|
3022
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
3023
|
+
- Ownership Changes: Reassign data ownership
|
|
3024
|
+
- Classification: Apply or modify data classifications
|
|
3025
|
+
"""
|
|
3026
|
+
return self.glossaryUpdateCategory(args)
|
|
3027
|
+
|
|
3028
|
+
@decorator
|
|
3029
|
+
def glossaryPutCategoryPartial(self, args):
|
|
3030
|
+
"""
|
|
3031
|
+
Update an existing glossary category.
|
|
3032
|
+
|
|
3033
|
+
Updates an existing glossary category with new values.
|
|
3034
|
+
Only specified fields are modified; others remain unchanged.
|
|
3035
|
+
|
|
3036
|
+
Args:
|
|
3037
|
+
args: Dictionary of operation arguments.
|
|
3038
|
+
Contains operation-specific parameters.
|
|
3039
|
+
See method implementation for details.
|
|
3040
|
+
|
|
3041
|
+
Returns:
|
|
3042
|
+
Dictionary containing updated glossary category:
|
|
3043
|
+
{
|
|
3044
|
+
'guid': str, # Unique identifier
|
|
3045
|
+
'attributes': dict, # Updated attributes
|
|
3046
|
+
'updateTime': int # Update timestamp
|
|
3047
|
+
}
|
|
3048
|
+
|
|
3049
|
+
Raises:
|
|
3050
|
+
ValueError: When required parameters are missing or invalid:
|
|
3051
|
+
- Empty or None values for required fields
|
|
3052
|
+
- Invalid GUID format
|
|
3053
|
+
- Out-of-range values
|
|
3054
|
+
|
|
3055
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
3056
|
+
- DefaultAzureCredential not configured
|
|
3057
|
+
- Insufficient permissions
|
|
3058
|
+
- Expired authentication token
|
|
3059
|
+
|
|
3060
|
+
HTTPError: When Purview API returns error:
|
|
3061
|
+
- 400: Bad request (invalid parameters)
|
|
3062
|
+
- 401: Unauthorized (authentication failed)
|
|
3063
|
+
- 403: Forbidden (insufficient permissions)
|
|
3064
|
+
- 404: Resource not found
|
|
3065
|
+
- 429: Rate limit exceeded
|
|
3066
|
+
- 500: Internal server error
|
|
3067
|
+
|
|
3068
|
+
NetworkError: When network connectivity fails
|
|
3069
|
+
|
|
3070
|
+
Example:
|
|
3071
|
+
# Basic usage
|
|
3072
|
+
client = Glossary()
|
|
3073
|
+
|
|
3074
|
+
result = client.glossaryPutCategoryPartial(args=...)
|
|
3075
|
+
print(f"Result: {result}")
|
|
3076
|
+
|
|
3077
|
+
# With detailed data
|
|
3078
|
+
data = {
|
|
3079
|
+
'name': 'My Resource',
|
|
3080
|
+
'description': 'Resource description',
|
|
3081
|
+
'attributes': {
|
|
3082
|
+
'key1': 'value1',
|
|
3083
|
+
'key2': 'value2'
|
|
3084
|
+
}
|
|
3085
|
+
}
|
|
3086
|
+
|
|
3087
|
+
result = client.glossaryPutCategoryPartial(data)
|
|
3088
|
+
print(f"Created/Updated: {result['guid']}")
|
|
3089
|
+
|
|
3090
|
+
Use Cases:
|
|
3091
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
3092
|
+
- Ownership Changes: Reassign data ownership
|
|
3093
|
+
- Classification: Apply or modify data classifications
|
|
3094
|
+
"""
|
|
3095
|
+
return self.glossaryUpdateCategoryPartial(args)
|
|
3096
|
+
|
|
3097
|
+
@decorator
|
|
3098
|
+
def glossaryPutTerm(self, args):
|
|
3099
|
+
"""
|
|
3100
|
+
Update an existing glossary term.
|
|
3101
|
+
|
|
3102
|
+
Updates an existing glossary term with new values.
|
|
3103
|
+
Only specified fields are modified; others remain unchanged.
|
|
3104
|
+
|
|
3105
|
+
Args:
|
|
3106
|
+
args: Dictionary of operation arguments.
|
|
3107
|
+
Contains operation-specific parameters.
|
|
3108
|
+
See method implementation for details.
|
|
3109
|
+
|
|
3110
|
+
Returns:
|
|
3111
|
+
Dictionary containing updated glossary term:
|
|
3112
|
+
{
|
|
3113
|
+
'guid': str, # Unique identifier
|
|
3114
|
+
'attributes': dict, # Updated attributes
|
|
3115
|
+
'updateTime': int # Update timestamp
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
Raises:
|
|
3119
|
+
ValueError: When required parameters are missing or invalid:
|
|
3120
|
+
- Empty or None values for required fields
|
|
3121
|
+
- Invalid GUID format
|
|
3122
|
+
- Out-of-range values
|
|
3123
|
+
|
|
3124
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
3125
|
+
- DefaultAzureCredential not configured
|
|
3126
|
+
- Insufficient permissions
|
|
3127
|
+
- Expired authentication token
|
|
3128
|
+
|
|
3129
|
+
HTTPError: When Purview API returns error:
|
|
3130
|
+
- 400: Bad request (invalid parameters)
|
|
3131
|
+
- 401: Unauthorized (authentication failed)
|
|
3132
|
+
- 403: Forbidden (insufficient permissions)
|
|
3133
|
+
- 404: Resource not found
|
|
3134
|
+
- 429: Rate limit exceeded
|
|
3135
|
+
- 500: Internal server error
|
|
3136
|
+
|
|
3137
|
+
NetworkError: When network connectivity fails
|
|
3138
|
+
|
|
3139
|
+
Example:
|
|
3140
|
+
# Basic usage
|
|
3141
|
+
client = Glossary()
|
|
3142
|
+
|
|
3143
|
+
result = client.glossaryPutTerm(args=...)
|
|
3144
|
+
print(f"Result: {result}")
|
|
3145
|
+
|
|
3146
|
+
# With detailed data
|
|
3147
|
+
data = {
|
|
3148
|
+
'name': 'My Resource',
|
|
3149
|
+
'description': 'Resource description',
|
|
3150
|
+
'attributes': {
|
|
3151
|
+
'key1': 'value1',
|
|
3152
|
+
'key2': 'value2'
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
result = client.glossaryPutTerm(data)
|
|
3157
|
+
print(f"Created/Updated: {result['guid']}")
|
|
3158
|
+
|
|
3159
|
+
Use Cases:
|
|
3160
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
3161
|
+
- Ownership Changes: Reassign data ownership
|
|
3162
|
+
- Classification: Apply or modify data classifications
|
|
3163
|
+
"""
|
|
3164
|
+
return self.glossaryUpdateTerm(args)
|
|
3165
|
+
|
|
3166
|
+
@decorator
|
|
3167
|
+
def glossaryPutTermPartial(self, args):
|
|
3168
|
+
"""
|
|
3169
|
+
Update an existing glossary term.
|
|
3170
|
+
|
|
3171
|
+
Updates an existing glossary term with new values.
|
|
3172
|
+
Only specified fields are modified; others remain unchanged.
|
|
3173
|
+
|
|
3174
|
+
Args:
|
|
3175
|
+
args: Dictionary of operation arguments.
|
|
3176
|
+
Contains operation-specific parameters.
|
|
3177
|
+
See method implementation for details.
|
|
3178
|
+
|
|
3179
|
+
Returns:
|
|
3180
|
+
Dictionary containing updated glossary term:
|
|
3181
|
+
{
|
|
3182
|
+
'guid': str, # Unique identifier
|
|
3183
|
+
'attributes': dict, # Updated attributes
|
|
3184
|
+
'updateTime': int # Update timestamp
|
|
3185
|
+
}
|
|
3186
|
+
|
|
3187
|
+
Raises:
|
|
3188
|
+
ValueError: When required parameters are missing or invalid:
|
|
3189
|
+
- Empty or None values for required fields
|
|
3190
|
+
- Invalid GUID format
|
|
3191
|
+
- Out-of-range values
|
|
3192
|
+
|
|
3193
|
+
AuthenticationError: When Azure credentials are invalid:
|
|
3194
|
+
- DefaultAzureCredential not configured
|
|
3195
|
+
- Insufficient permissions
|
|
3196
|
+
- Expired authentication token
|
|
3197
|
+
|
|
3198
|
+
HTTPError: When Purview API returns error:
|
|
3199
|
+
- 400: Bad request (invalid parameters)
|
|
3200
|
+
- 401: Unauthorized (authentication failed)
|
|
3201
|
+
- 403: Forbidden (insufficient permissions)
|
|
3202
|
+
- 404: Resource not found
|
|
3203
|
+
- 429: Rate limit exceeded
|
|
3204
|
+
- 500: Internal server error
|
|
3205
|
+
|
|
3206
|
+
NetworkError: When network connectivity fails
|
|
3207
|
+
|
|
3208
|
+
Example:
|
|
3209
|
+
# Basic usage
|
|
3210
|
+
client = Glossary()
|
|
3211
|
+
|
|
3212
|
+
result = client.glossaryPutTermPartial(args=...)
|
|
3213
|
+
print(f"Result: {result}")
|
|
3214
|
+
|
|
3215
|
+
# With detailed data
|
|
3216
|
+
data = {
|
|
3217
|
+
'name': 'My Resource',
|
|
3218
|
+
'description': 'Resource description',
|
|
3219
|
+
'attributes': {
|
|
3220
|
+
'key1': 'value1',
|
|
3221
|
+
'key2': 'value2'
|
|
3222
|
+
}
|
|
3223
|
+
}
|
|
3224
|
+
|
|
3225
|
+
result = client.glossaryPutTermPartial(data)
|
|
3226
|
+
print(f"Created/Updated: {result['guid']}")
|
|
3227
|
+
|
|
3228
|
+
Use Cases:
|
|
3229
|
+
- Metadata Enrichment: Update descriptions and tags
|
|
3230
|
+
- Ownership Changes: Reassign data ownership
|
|
3231
|
+
- Classification: Apply or modify data classifications
|
|
3232
|
+
"""
|
|
3233
|
+
return self.glossaryUpdateTermPartial(args)
|