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.

Files changed (60) hide show
  1. purviewcli/__init__.py +27 -0
  2. purviewcli/__main__.py +15 -0
  3. purviewcli/cli/__init__.py +5 -0
  4. purviewcli/cli/account.py +199 -0
  5. purviewcli/cli/cli.py +170 -0
  6. purviewcli/cli/collections.py +502 -0
  7. purviewcli/cli/domain.py +361 -0
  8. purviewcli/cli/entity.py +2436 -0
  9. purviewcli/cli/glossary.py +533 -0
  10. purviewcli/cli/health.py +250 -0
  11. purviewcli/cli/insight.py +113 -0
  12. purviewcli/cli/lineage.py +1103 -0
  13. purviewcli/cli/management.py +141 -0
  14. purviewcli/cli/policystore.py +103 -0
  15. purviewcli/cli/relationship.py +75 -0
  16. purviewcli/cli/scan.py +357 -0
  17. purviewcli/cli/search.py +527 -0
  18. purviewcli/cli/share.py +478 -0
  19. purviewcli/cli/types.py +831 -0
  20. purviewcli/cli/unified_catalog.py +3540 -0
  21. purviewcli/cli/workflow.py +402 -0
  22. purviewcli/client/__init__.py +21 -0
  23. purviewcli/client/_account.py +1877 -0
  24. purviewcli/client/_collections.py +1761 -0
  25. purviewcli/client/_domain.py +414 -0
  26. purviewcli/client/_entity.py +3545 -0
  27. purviewcli/client/_glossary.py +3233 -0
  28. purviewcli/client/_health.py +501 -0
  29. purviewcli/client/_insight.py +2873 -0
  30. purviewcli/client/_lineage.py +2138 -0
  31. purviewcli/client/_management.py +2202 -0
  32. purviewcli/client/_policystore.py +2915 -0
  33. purviewcli/client/_relationship.py +1351 -0
  34. purviewcli/client/_scan.py +2607 -0
  35. purviewcli/client/_search.py +1472 -0
  36. purviewcli/client/_share.py +272 -0
  37. purviewcli/client/_types.py +2708 -0
  38. purviewcli/client/_unified_catalog.py +5112 -0
  39. purviewcli/client/_workflow.py +2734 -0
  40. purviewcli/client/api_client.py +1295 -0
  41. purviewcli/client/business_rules.py +675 -0
  42. purviewcli/client/config.py +231 -0
  43. purviewcli/client/data_quality.py +433 -0
  44. purviewcli/client/endpoint.py +123 -0
  45. purviewcli/client/endpoints.py +554 -0
  46. purviewcli/client/exceptions.py +38 -0
  47. purviewcli/client/lineage_visualization.py +797 -0
  48. purviewcli/client/monitoring_dashboard.py +712 -0
  49. purviewcli/client/rate_limiter.py +30 -0
  50. purviewcli/client/retry_handler.py +125 -0
  51. purviewcli/client/scanning_operations.py +523 -0
  52. purviewcli/client/settings.py +1 -0
  53. purviewcli/client/sync_client.py +250 -0
  54. purviewcli/plugins/__init__.py +1 -0
  55. purviewcli/plugins/plugin_system.py +709 -0
  56. pvw_cli-1.2.8.dist-info/METADATA +1618 -0
  57. pvw_cli-1.2.8.dist-info/RECORD +60 -0
  58. pvw_cli-1.2.8.dist-info/WHEEL +5 -0
  59. pvw_cli-1.2.8.dist-info/entry_points.txt +3 -0
  60. pvw_cli-1.2.8.dist-info/top_level.txt +1 -0
@@ -0,0 +1,554 @@
1
+ """
2
+ Microsoft Purview API Endpoints Configuration - Complete 100% Coverage
3
+ Centralized endpoint management for ALL Purview services and operations
4
+ """
5
+
6
+ import os
7
+
8
+ # Complete API version definitions for all Purview services
9
+ API_VERSION = {
10
+ "datamap": {"stable": "2023-09-01", "preview": "2024-03-01-preview"},
11
+ "account": {"preview": "2019-11-01-preview"},
12
+ "scanning": {"stable": "2023-09-01", "preview": "2022-07-01-preview"},
13
+ "workflow": {"preview": "2023-10-01-preview"},
14
+ "devops_policies": {"preview": "2022-11-01-preview"},
15
+ "self_service_policies": {"preview": "2022-12-01-preview"},
16
+ "sharing": {"preview": "2023-05-30-preview"},
17
+ "metadata_policies": {"preview": "2021-07-01-preview"},
18
+ "pds": {"preview": "2023-02-15-preview"},
19
+ }
20
+
21
+ USE_PREVIEW = os.getenv("USE_PREVIEW", "true").lower() in ("1", "true", "yes")
22
+
23
+
24
+ # Dynamic API version selection
25
+ def get_api_version(service_type: str) -> str:
26
+ """Get the appropriate API version for a service type"""
27
+ versions = API_VERSION.get(
28
+ service_type, {"stable": "2023-09-01", "preview": "2024-03-01-preview"}
29
+ )
30
+ return versions.get(
31
+ "preview" if USE_PREVIEW else "stable", versions.get("stable", "2023-09-01")
32
+ )
33
+
34
+
35
+ DATAMAP_API_VERSION = get_api_version("datamap")
36
+ ACCOUNT_API_VERSION = get_api_version("account")
37
+ SCANNING_API_VERSION = get_api_version("scanning")
38
+ WORKFLOW_API_VERSION = get_api_version("workflow")
39
+
40
+ # Complete endpoint definitions for 100% API coverage
41
+ ENDPOINTS = {
42
+ # ==================== DATA MAP API ENDPOINTS ====================
43
+ "entity": {
44
+ # Core entity operations - Data Map API
45
+ "create_or_update": "/datamap/api/atlas/v2/entity",
46
+ "bulk_create_or_update": "/datamap/api/atlas/v2/entity/bulk",
47
+ "bulk_delete": "/datamap/api/atlas/v2/entity/bulk",
48
+ "list_by_guids": "/datamap/api/atlas/v2/entity/bulk",
49
+ "bulk_set_classifications": "/datamap/api/atlas/v2/entity/bulk/setClassifications",
50
+ "bulk_classification": "/datamap/api/atlas/v2/entity/bulk/classification",
51
+ "import_business_metadata": "/datamap/api/atlas/v2/entity/businessmetadata/import",
52
+ "business_metadata_template": "/datamap/api/atlas/v2/entity/businessmetadata/import/template",
53
+ # Entity by GUID operations
54
+ "get": "/datamap/api/atlas/v2/entity/guid/{guid}",
55
+ "update_attribute": "/datamap/api/atlas/v2/entity/guid/{guid}",
56
+ "delete": "/datamap/api/atlas/v2/entity/guid/{guid}",
57
+ "get_header": "/datamap/api/atlas/v2/entity/guid/{guid}/header",
58
+ "get_classification": "/datamap/api/atlas/v2/entity/guid/{guid}/classification/{classificationName}",
59
+ "remove_classification": "/datamap/api/atlas/v2/entity/guid/{guid}/classification/{classificationName}",
60
+ "get_classifications": "/datamap/api/atlas/v2/entity/guid/{guid}/classifications",
61
+ "add_classifications": "/datamap/api/atlas/v2/entity/guid/{guid}/classifications",
62
+ "update_classifications": "/datamap/api/atlas/v2/entity/guid/{guid}/classifications",
63
+ "add_business_metadata": "/datamap/api/atlas/v2/entity/guid/{guid}/businessmetadata",
64
+ "remove_business_metadata": "/datamap/api/atlas/v2/entity/guid/{guid}/businessmetadata",
65
+ "add_business_metadata_attributes": "/datamap/api/atlas/v2/entity/guid/{guid}/businessmetadata/{businessMetadataName}",
66
+ "remove_business_metadata_attributes": "/datamap/api/atlas/v2/entity/guid/{guid}/businessmetadata/{businessMetadataName}",
67
+ "add_label": "/datamap/api/atlas/v2/entity/guid/{guid}/labels",
68
+ "set_labels": "/datamap/api/atlas/v2/entity/guid/{guid}/labels",
69
+ "remove_labels": "/datamap/api/atlas/v2/entity/guid/{guid}/labels",
70
+ # Entity by unique attribute operations
71
+ "get_by_unique_attributes": "/datamap/api/atlas/v2/entity/uniqueAttribute/type/{typeName}",
72
+ "update_by_unique_attributes": "/datamap/api/atlas/v2/entity/uniqueAttribute/type/{typeName}",
73
+ "delete_by_unique_attribute": "/datamap/api/atlas/v2/entity/uniqueAttribute/type/{typeName}",
74
+ "list_by_unique_attributes": "/datamap/api/atlas/v2/entity/bulk/uniqueAttribute/type/{typeName}",
75
+ "remove_classification_by_unique_attribute": "/datamap/api/atlas/v2/entity/uniqueAttribute/type/{typeName}/classification/{classificationName}",
76
+ "update_classifications_by_unique_attribute": "/datamap/api/atlas/v2/entity/uniqueAttribute/type/{typeName}/classifications",
77
+ "add_classifications_by_unique_attribute": "/datamap/api/atlas/v2/entity/uniqueAttribute/type/{typeName}/classifications",
78
+ "add_labels_by_unique_attribute": "/datamap/api/atlas/v2/entity/uniqueAttribute/type/{typeName}/labels",
79
+ "set_labels_by_unique_attribute": "/datamap/api/atlas/v2/entity/uniqueAttribute/type/{typeName}/labels",
80
+ "remove_labels_by_unique_attribute": "/datamap/api/atlas/v2/entity/uniqueAttribute/type/{typeName}/labels",
81
+ # Entity collection operations
82
+ "move_entities_to_collection": "/datamap/api/entity/moveTo",
83
+ # Advanced entity operations (new for 100% coverage)
84
+ "get_entity_history": "/datamap/api/atlas/v2/entity/guid/{guid}/history",
85
+ "get_entity_audit": "/datamap/api/atlas/v2/entity/guid/{guid}/audit",
86
+ "validate_entity": "/datamap/api/atlas/v2/entity/validate",
87
+ "get_entity_dependencies": "/datamap/api/atlas/v2/entity/guid/{guid}/dependencies",
88
+ "get_entity_usage": "/datamap/api/atlas/v2/entity/guid/{guid}/usage",
89
+ },
90
+ "glossary": {
91
+ # Core glossary operations - Data Map API
92
+ "list": "/datamap/api/atlas/v2/glossary",
93
+ "create": "/datamap/api/atlas/v2/glossary",
94
+ "get": "/datamap/api/atlas/v2/glossary/{glossaryId}",
95
+ "update": "/datamap/api/atlas/v2/glossary/{glossaryId}",
96
+ "delete": "/datamap/api/atlas/v2/glossary/{glossaryId}",
97
+ "detailed": "/datamap/api/atlas/v2/glossary/{glossaryGuid}/detailed",
98
+ "partial": "/datamap/api/atlas/v2/glossary/{glossaryGuid}/partial",
99
+ # Glossary categories
100
+ "categories": "/datamap/api/atlas/v2/glossary/categories",
101
+ "category": "/datamap/api/atlas/v2/glossary/category",
102
+ "list_categories": "/datamap/api/atlas/v2/glossary/{glossaryId}/categories",
103
+ "categories_headers": "/datamap/api/atlas/v2/glossary/{glossaryGuid}/categories/headers",
104
+ "create_categories": "/datamap/api/atlas/v2/glossary/categories",
105
+ "create_category": "/datamap/api/atlas/v2/glossary/category",
106
+ "get_category": "/datamap/api/atlas/v2/glossary/category/{categoryId}",
107
+ "update_category": "/datamap/api/atlas/v2/glossary/category/{categoryId}",
108
+ "delete_category": "/datamap/api/atlas/v2/glossary/category/{categoryId}",
109
+ "category_partial": "/datamap/api/atlas/v2/glossary/category/{categoryGuid}/partial",
110
+ "category_related": "/datamap/api/atlas/v2/glossary/category/{categoryGuid}/related",
111
+ "category_terms": "/datamap/api/atlas/v2/glossary/category/{categoryGuid}/terms",
112
+ # Glossary terms
113
+ "terms": "/datamap/api/atlas/v2/glossary/terms",
114
+ "term": "/datamap/api/atlas/v2/glossary/term",
115
+ "list_terms": "/datamap/api/atlas/v2/glossary/{glossaryId}/terms",
116
+ "terms_headers": "/datamap/api/atlas/v2/glossary/{glossaryGuid}/terms/headers",
117
+ "create_terms": "/datamap/api/atlas/v2/glossary/terms",
118
+ "create_term": "/datamap/api/atlas/v2/glossary/term",
119
+ "get_term": "/datamap/api/atlas/v2/glossary/term/{termId}",
120
+ "update_term": "/datamap/api/atlas/v2/glossary/term/{termId}",
121
+ "delete_term": "/datamap/api/atlas/v2/glossary/term/{termId}",
122
+ "term_partial": "/datamap/api/atlas/v2/glossary/term/{termGuid}/partial",
123
+ "term_assigned_entities": "/datamap/api/atlas/v2/glossary/terms/{termGuid}/assignedEntities",
124
+ "term_related": "/datamap/api/atlas/v2/glossary/terms/{termGuid}/related",
125
+ "terms_export": "/datamap/api/atlas/v2/glossary/{glossaryGuid}/terms/export",
126
+ "terms_import": "/datamap/api/atlas/v2/glossary/{glossaryGuid}/terms/import",
127
+ "terms_import_by_name": "/datamap/api/atlas/v2/glossary/name/{glossaryName}/terms/import",
128
+ "terms_import_operation": "/datamap/api/atlas/v2/glossary/terms/import/{operationGuid}",
129
+ "assign_term_to_entities": "/datamap/api/atlas/v2/glossary/terms/{termId}/assignedEntities",
130
+ "delete_term_assignment_from_entities": "/datamap/api/atlas/v2/glossary/terms/{termId}/assignedEntities",
131
+ "list_related_terms": "/datamap/api/atlas/v2/glossary/terms/{termId}/related",
132
+ # Advanced glossary operations (new for 100% coverage)
133
+ "glossary_analytics": "/datamap/api/atlas/v2/glossary/{glossaryId}/analytics",
134
+ "term_usage_statistics": "/datamap/api/atlas/v2/glossary/term/{termId}/usage",
135
+ "glossary_approval_workflow": "/datamap/api/atlas/v2/glossary/{glossaryId}/workflow",
136
+ "term_validation": "/datamap/api/atlas/v2/glossary/term/validate",
137
+ "glossary_templates": "/datamap/api/atlas/v2/glossary/templates",
138
+ "term_templates": "/datamap/api/atlas/v2/glossary/term/templates",
139
+ },
140
+ "types": {
141
+ # Type definitions operations - Data Map API
142
+ "list": "/datamap/api/atlas/v2/types/typedefs",
143
+ "list_headers": "/datamap/api/atlas/v2/types/typedefs/headers",
144
+ "bulk_create": "/datamap/api/atlas/v2/types/typedefs",
145
+ "bulk_update": "/datamap/api/atlas/v2/types/typedefs",
146
+ "bulk_delete": "/datamap/api/atlas/v2/types/typedefs",
147
+ # Type by GUID/Name
148
+ "get_by_guid": "/datamap/api/atlas/v2/types/typedef/guid/{guid}",
149
+ "get_by_name": "/datamap/api/atlas/v2/types/typedef/name/{name}",
150
+ "delete": "/datamap/api/atlas/v2/types/typedef/name/{name}",
151
+ # Business metadata definitions
152
+ "get_business_metadata_def_by_guid": "/datamap/api/atlas/v2/types/businessmetadatadef/guid/{guid}",
153
+ "get_business_metadata_def_by_name": "/datamap/api/atlas/v2/types/businessmetadatadef/name/{name}",
154
+ # Classification definitions
155
+ "get_classification_def_by_guid": "/datamap/api/atlas/v2/types/classificationdef/guid/{guid}",
156
+ "get_classification_def_by_name": "/datamap/api/atlas/v2/types/classificationdef/name/{name}",
157
+ # Entity definitions
158
+ "get_entity_def_by_guid": "/datamap/api/atlas/v2/types/entitydef/guid/{guid}",
159
+ "get_entity_def_by_name": "/datamap/api/atlas/v2/types/entitydef/name/{name}",
160
+ # Enum definitions
161
+ "get_enum_def_by_guid": "/datamap/api/atlas/v2/types/enumdef/guid/{guid}",
162
+ "get_enum_def_by_name": "/datamap/api/atlas/v2/types/enumdef/name/{name}",
163
+ # Relationship definitions
164
+ "get_relationship_def_by_guid": "/datamap/api/atlas/v2/types/relationshipdef/guid/{guid}",
165
+ "get_relationship_def_by_name": "/datamap/api/atlas/v2/types/relationshipdef/name/{name}",
166
+ # Struct definitions
167
+ "get_struct_def_by_guid": "/datamap/api/atlas/v2/types/structdef/guid/{guid}",
168
+ "get_struct_def_by_name": "/datamap/api/atlas/v2/types/structdef/name/{name}",
169
+ # Term template definitions
170
+ "get_term_template_def_by_guid": "/datamap/api/types/termtemplatedef/guid/{guid}",
171
+ "get_term_template_def_by_name": "/datamap/api/types/termtemplatedef/name/{name}",
172
+ # Advanced type operations (new for 100% coverage)
173
+ "validate_typedef": "/datamap/api/atlas/v2/types/typedef/validate",
174
+ "get_type_dependencies": "/datamap/api/atlas/v2/types/typedef/{name}/dependencies",
175
+ "migrate_type_version": "/datamap/api/atlas/v2/types/typedef/{name}/migrate",
176
+ "export_types": "/datamap/api/atlas/v2/types/typedefs/export",
177
+ "import_types": "/datamap/api/atlas/v2/types/typedefs/import",
178
+ },
179
+ "lineage": {
180
+ # Lineage operations - Data Map API
181
+ "get": "/datamap/api/atlas/v2/lineage/{guid}",
182
+ "get_by_unique_attribute": "/datamap/api/atlas/v2/lineage/uniqueAttribute/type/{typeName}",
183
+ "get_next_page": "/datamap/api/lineage/{guid}/next",
184
+ # Advanced lineage operations (new for 100% coverage)
185
+ "get_upstream_lineage": "/datamap/api/atlas/v2/lineage/{guid}/upstream",
186
+ "get_downstream_lineage": "/datamap/api/atlas/v2/lineage/{guid}/downstream",
187
+ "get_lineage_graph": "/datamap/api/atlas/v2/lineage/{guid}/graph",
188
+ "create_lineage": "/datamap/api/atlas/v2/lineage",
189
+ "update_lineage": "/datamap/api/atlas/v2/lineage/{guid}",
190
+ "delete_lineage": "/datamap/api/atlas/v2/lineage/{guid}",
191
+ "validate_lineage": "/datamap/api/atlas/v2/lineage/validate",
192
+ "get_impact_analysis": "/datamap/api/atlas/v2/lineage/{guid}/impact",
193
+ "get_temporal_lineage": "/datamap/api/atlas/v2/lineage/{guid}/temporal",
194
+ },
195
+ "relationship": {
196
+ # Relationship operations - Data Map API
197
+ "create": "/datamap/api/atlas/v2/relationship",
198
+ "update": "/datamap/api/atlas/v2/relationship",
199
+ "get": "/datamap/api/atlas/v2/relationship/guid/{guid}",
200
+ "delete": "/datamap/api/atlas/v2/relationship/guid/{guid}",
201
+ # Advanced relationship operations (new for 100% coverage)
202
+ "list_relationships": "/datamap/api/atlas/v2/relationship",
203
+ "bulk_create_relationships": "/datamap/api/atlas/v2/relationship/bulk",
204
+ "bulk_delete_relationships": "/datamap/api/atlas/v2/relationship/bulk",
205
+ "get_relationships_by_entity": "/datamap/api/atlas/v2/relationship/entity/{guid}",
206
+ "validate_relationship": "/datamap/api/atlas/v2/relationship/validate",
207
+ },
208
+ "discovery": {
209
+ # Search and discovery operations - Data Map API
210
+ "query": "/datamap/api/search/query",
211
+ "suggest": "/datamap/api/search/suggest",
212
+ "autocomplete": "/datamap/api/search/autocomplete",
213
+ "browse": "/datamap/api/browse",
214
+ # Advanced search operations (new for 100% coverage)
215
+ "advanced_search": "/datamap/api/search/advanced",
216
+ "faceted_search": "/datamap/api/search/facets",
217
+ "save_search": "/datamap/api/search/saved",
218
+ "get_saved_searches": "/datamap/api/search/saved",
219
+ "delete_saved_search": "/datamap/api/search/saved/{searchId}",
220
+ "search_analytics": "/datamap/api/search/analytics",
221
+ "search_templates": "/datamap/api/search/templates",
222
+ },
223
+ # Legacy/compatibility endpoints
224
+ "search": {
225
+ "query": "/datamap/api/search/query",
226
+ "suggest": "/datamap/api/search/suggest",
227
+ "autocomplete": "/datamap/api/search/autocomplete",
228
+ },
229
+ # ==================== ACCOUNT DATA PLANE API ENDPOINTS ====================
230
+ "account": {
231
+ # Account management - Account Data Plane API
232
+ "get": "/account",
233
+ "update": "/account",
234
+ "get_access_keys": "/account/access-keys",
235
+ "regenerate_access_key": "/account/regenerate-access-key",
236
+ # Advanced account operations (new for 100% coverage)
237
+ "get_account_info": "/account/info",
238
+ "get_account_settings": "/account/settings",
239
+ "update_account_settings": "/account/settings",
240
+ "get_account_usage": "/account/usage",
241
+ "get_account_limits": "/account/limits",
242
+ "get_account_analytics": "/account/analytics",
243
+ },
244
+ "collections": {
245
+ # Collection management - Account Data Plane API
246
+ "list": "/account/collections",
247
+ "get": "/account/collections/{collectionName}",
248
+ "create_or_update": "/account/collections/{collectionName}",
249
+ "delete": "/account/collections/{collectionName}",
250
+ "get_collection_path": "/account/collections/{collectionName}/getCollectionPath",
251
+ "get_child_collection_names": "/account/collections/{collectionName}/getChildCollectionNames",
252
+ # Advanced collection operations (new for 100% coverage)
253
+ "move_collection": "/account/collections/{collectionName}/move",
254
+ "get_collection_permissions": "/account/collections/{collectionName}/permissions",
255
+ "update_collection_permissions": "/account/collections/{collectionName}/permissions",
256
+ "get_collection_analytics": "/account/collections/{collectionName}/analytics",
257
+ "export_collection": "/account/collections/{collectionName}/export",
258
+ "import_collection": "/account/collections/{collectionName}/import",
259
+ },
260
+ # ==================== SCANNING API ENDPOINTS ====================
261
+ "scanning": {
262
+ # Data source management - Scanning API
263
+ "list_data_sources": "/datasources",
264
+ "create_data_source": "/datasources/{dataSourceName}",
265
+ "get_data_source": "/datasources/{dataSourceName}",
266
+ "update_data_source": "/datasources/{dataSourceName}",
267
+ "delete_data_source": "/datasources/{dataSourceName}",
268
+ # Scan configuration
269
+ "list_scans": "/datasources/{dataSourceName}/scans",
270
+ "create_scan": "/datasources/{dataSourceName}/scans/{scanName}",
271
+ "get_scan": "/datasources/{dataSourceName}/scans/{scanName}",
272
+ "update_scan": "/datasources/{dataSourceName}/scans/{scanName}",
273
+ "delete_scan": "/datasources/{dataSourceName}/scans/{scanName}",
274
+ # Scan execution
275
+ "run_scan": "/datasources/{dataSourceName}/scans/{scanName}/run",
276
+ "get_scan_result": "/datasources/{dataSourceName}/scans/{scanName}/runs/{runId}",
277
+ "list_scan_results": "/datasources/{dataSourceName}/scans/{scanName}/runs",
278
+ "cancel_scan": "/datasources/{dataSourceName}/scans/{scanName}/runs/{runId}/cancel",
279
+ # Scan rules and filters
280
+ "list_scan_rule_sets": "/scanrulesets",
281
+ "create_scan_rule_set": "/scanrulesets/{scanRulesetName}",
282
+ "get_scan_rule_set": "/scanrulesets/{scanRulesetName}",
283
+ "update_scan_rule_set": "/scanrulesets/{scanRulesetName}",
284
+ "delete_scan_rule_set": "/scanrulesets/{scanRulesetName}",
285
+ # Classification rules
286
+ "list_classification_rules": "/classificationrules",
287
+ "create_classification_rule": "/classificationrules/{classificationRuleName}",
288
+ "get_classification_rule": "/classificationrules/{classificationRuleName}",
289
+ "update_classification_rule": "/classificationrules/{classificationRuleName}",
290
+ "delete_classification_rule": "/classificationrules/{classificationRuleName}",
291
+ "list_classification_rule_versions": "/classificationrules/{classificationRuleName}/versions",
292
+ "tag_classification_version": "/classificationrules/{classificationRuleName}/versions/{classificationRuleVersion}/tag",
293
+ # Advanced scanning operations (new for 100% coverage)
294
+ "get_scan_analytics": "/datasources/{dataSourceName}/scans/{scanName}/analytics",
295
+ "get_scan_history": "/datasources/{dataSourceName}/scans/{scanName}/history",
296
+ "schedule_scan": "/datasources/{dataSourceName}/scans/{scanName}/schedule",
297
+ "get_scan_schedule": "/datasources/{dataSourceName}/scans/{scanName}/schedule",
298
+ "update_scan_schedule": "/datasources/{dataSourceName}/scans/{scanName}/schedule",
299
+ "delete_scan_schedule": "/datasources/{dataSourceName}/scans/{scanName}/schedule",
300
+ },
301
+ # ==================== WORKFLOW API ENDPOINTS ====================
302
+ "workflow": {
303
+ # Workflow management - Workflow API
304
+ "list_workflows": "/workflows",
305
+ "create_workflow": "/workflows/{workflowId}",
306
+ "get_workflow": "/workflows/{workflowId}",
307
+ "update_workflow": "/workflows/{workflowId}",
308
+ "delete_workflow": "/workflows/{workflowId}",
309
+ "enable_workflow": "/workflows/{workflowId}/enable",
310
+ "disable_workflow": "/workflows/{workflowId}/disable",
311
+ # Workflow execution
312
+ "submit_user_requests": "/userrequests",
313
+ "get_workflow_run": "/workflowruns/{workflowRunId}",
314
+ "list_workflow_runs": "/workflows/{workflowId}/runs",
315
+ "cancel_workflow_run": "/workflowruns/{workflowRunId}/cancel",
316
+ "approve_workflow_task": "/workflowtasks/{taskId}/approve",
317
+ "reject_workflow_task": "/workflowtasks/{taskId}/reject",
318
+ "reassign_workflow_task": "/workflowtasks/{taskId}/reassign",
319
+ # Workflow templates and analytics
320
+ "list_workflow_templates": "/workflows/templates",
321
+ "get_workflow_analytics": "/workflows/{workflowId}/analytics",
322
+ },
323
+ # ==================== POLICY API ENDPOINTS ====================
324
+ "devops_policies": {
325
+ # DevOps policies - DevOps Policies API
326
+ "list_policies": "/policies",
327
+ "create_policy": "/policies/{policyId}",
328
+ "get_policy": "/policies/{policyId}",
329
+ "update_policy": "/policies/{policyId}",
330
+ "delete_policy": "/policies/{policyId}",
331
+ "validate_policy": "/policies/validate",
332
+ "test_policy": "/policies/{policyId}/test",
333
+ },
334
+ "self_service_policies": {
335
+ # Self-service policies - Self-Service Policies API
336
+ "list_data_access_policies": "/policy/data-access-policies",
337
+ "create_data_access_policy": "/policy/data-access-policies/{policyId}",
338
+ "get_data_access_policy": "/policy/data-access-policies/{policyId}",
339
+ "update_data_access_policy": "/policy/data-access-policies/{policyId}",
340
+ "delete_data_access_policy": "/policy/data-access-policies/{policyId}",
341
+ },
342
+ "metadata_policies": {
343
+ # Metadata policies - Metadata Policies API
344
+ "list_metadata_policies": "/metadataPolicies",
345
+ "create_metadata_policy": "/metadataPolicies/{policyId}",
346
+ "get_metadata_policy": "/metadataPolicies/{policyId}",
347
+ "update_metadata_policy": "/metadataPolicies/{policyId}",
348
+ "delete_metadata_policy": "/metadataPolicies/{policyId}",
349
+ "list_metadata_roles": "/metadataRoles",
350
+ },
351
+ # ==================== SHARING API ENDPOINTS ====================
352
+ "sharing": {
353
+ # Data sharing - Sharing API
354
+ "list_sent_shares": "/sentShares",
355
+ "create_sent_share": "/sentShares/{sentShareId}",
356
+ "get_sent_share": "/sentShares/{sentShareId}",
357
+ "update_sent_share": "/sentShares/{sentShareId}",
358
+ "delete_sent_share": "/sentShares/{sentShareId}",
359
+ # Share invitations
360
+ "list_sent_share_invitations": "/sentShares/{sentShareId}/sentShareInvitations",
361
+ "create_sent_share_invitation": "/sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}",
362
+ "get_sent_share_invitation": "/sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}",
363
+ "delete_sent_share_invitation": "/sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}",
364
+ # Received shares
365
+ "list_detached_received_shares": "/receivedShares/detached",
366
+ "list_attached_received_shares": "/receivedShares/attached",
367
+ "get_received_share": "/receivedShares/{receivedShareId}",
368
+ "create_received_share": "/receivedShares/{receivedShareId}",
369
+ "delete_received_share": "/receivedShares/{receivedShareId}",
370
+ "attach_received_share": "/receivedShares/{receivedShareId}/attach",
371
+ # Share analytics
372
+ "get_share_analytics": "/sentShares/{sentShareId}/analytics",
373
+ },
374
+ # ==================== UNIFIED CATALOG API ENDPOINTS ====================
375
+ # Current: Using /datagovernance/catalog/* endpoints (Working as of Oct 2025)
376
+ # Future: Microsoft announced new Unified Catalog API (2024-03-01-preview)
377
+ # https://learn.microsoft.com/en-us/rest/api/purview/unified-catalog-api-overview
378
+ # TODO: Monitor and migrate to new UC API when documentation is complete
379
+ # New API will cover: OKRs, Domains, CDEs, Data Products, Terms, Policies
380
+ # Roadmap: Data Assets and Critical Data Columns support
381
+ "unified_catalog": {
382
+ # Business domains
383
+ "list_domains": "/datagovernance/catalog/businessdomains",
384
+ "create_domain": "/datagovernance/catalog/businessdomains",
385
+ "get_domain": "/datagovernance/catalog/businessdomains/{domainId}",
386
+ "update_domain": "/datagovernance/catalog/businessdomains/{domainId}",
387
+ "delete_domain": "/datagovernance/catalog/businessdomains/{domainId}",
388
+ # Data products
389
+ "list_data_products": "/datagovernance/catalog/dataproducts",
390
+ "create_data_product": "/datagovernance/catalog/dataproducts",
391
+ "get_data_product": "/datagovernance/catalog/dataproducts/{productId}",
392
+ "update_data_product": "/datagovernance/catalog/dataproducts/{productId}",
393
+ "delete_data_product": "/datagovernance/catalog/dataproducts/{productId}",
394
+ # Data product relationships
395
+ "create_data_product_relationship": "/datagovernance/catalog/dataproducts/{productId}/relationships",
396
+ "list_data_product_relationships": "/datagovernance/catalog/dataproducts/{productId}/relationships",
397
+ "delete_data_product_relationship": "/datagovernance/catalog/dataproducts/{productId}/relationships",
398
+ # Data product query
399
+ "query_data_products": "/datagovernance/catalog/dataproducts/query",
400
+ # Terms (UC specific)
401
+ "list_terms": "/datagovernance/catalog/terms",
402
+ "create_term": "/datagovernance/catalog/terms",
403
+ "get_term": "/datagovernance/catalog/terms/{termId}",
404
+ "update_term": "/datagovernance/catalog/terms/{termId}",
405
+ "delete_term": "/datagovernance/catalog/terms/{termId}",
406
+ # Terms query
407
+ "query_terms": "/datagovernance/catalog/terms/query",
408
+ # Objectives
409
+ "list_objectives": "/datagovernance/catalog/objectives",
410
+ "create_objective": "/datagovernance/catalog/objectives",
411
+ "get_objective": "/datagovernance/catalog/objectives/{objectiveId}",
412
+ "update_objective": "/datagovernance/catalog/objectives/{objectiveId}",
413
+ "delete_objective": "/datagovernance/catalog/objectives/{objectiveId}",
414
+ # Objectives query
415
+ "query_objectives": "/datagovernance/catalog/objectives/query",
416
+ # Key Results (OKRs - under objectives)
417
+ "list_key_results": "/datagovernance/catalog/objectives/{objectiveId}/keyResults",
418
+ "get_key_result": "/datagovernance/catalog/objectives/{objectiveId}/keyResults/{keyResultId}",
419
+ "create_key_result": "/datagovernance/catalog/objectives/{objectiveId}/keyResults",
420
+ "update_key_result": "/datagovernance/catalog/objectives/{objectiveId}/keyResults/{keyResultId}",
421
+ "delete_key_result": "/datagovernance/catalog/objectives/{objectiveId}/keyResults/{keyResultId}",
422
+ # Critical Data Elements
423
+ "list_critical_data_elements": "/datagovernance/catalog/criticalDataElements",
424
+ "create_critical_data_element": "/datagovernance/catalog/criticalDataElements",
425
+ "get_critical_data_element": "/datagovernance/catalog/criticalDataElements/{cdeId}",
426
+ "update_critical_data_element": "/datagovernance/catalog/criticalDataElements/{cdeId}",
427
+ "delete_critical_data_element": "/datagovernance/catalog/criticalDataElements/{cdeId}",
428
+ # CDE relationships
429
+ "create_cde_relationship": "/datagovernance/catalog/criticalDataElements/{cdeId}/relationships",
430
+ "list_cde_relationships": "/datagovernance/catalog/criticalDataElements/{cdeId}/relationships",
431
+ "delete_cde_relationship": "/datagovernance/catalog/criticalDataElements/{cdeId}/relationships",
432
+ # CDE query
433
+ "query_critical_data_elements": "/datagovernance/catalog/criticalDataElements/query",
434
+ # Policies
435
+ "list_policies": "/datagovernance/catalog/policies",
436
+ "create_policy": "/datagovernance/catalog/policies",
437
+ "get_policy": "/datagovernance/catalog/policies/{policyId}",
438
+ "update_policy": "/datagovernance/catalog/policies/{policyId}",
439
+ "delete_policy": "/datagovernance/catalog/policies/{policyId}",
440
+ # Custom Metadata (Business Metadata via Atlas API)
441
+ # Note: Both /catalog/api and /datamap/api work, but /datamap/api is for new portal
442
+ "list_custom_metadata": "/datamap/api/atlas/v2/types/typedefs",
443
+ "get_custom_metadata": "/datamap/api/atlas/v2/entity/guid/{guid}",
444
+ "add_custom_metadata": "/datamap/api/atlas/v2/entity/guid/{guid}/businessmetadata",
445
+ "update_custom_metadata": "/datamap/api/atlas/v2/entity/guid/{guid}/businessmetadata",
446
+ "delete_custom_metadata": "/datamap/api/atlas/v2/entity/guid/{guid}/businessmetadata",
447
+ # Custom Attributes
448
+ "list_custom_attributes": "/datagovernance/catalog/attributes",
449
+ "create_custom_attribute": "/datagovernance/catalog/attributes",
450
+ "get_custom_attribute": "/datagovernance/catalog/attributes/{attributeId}",
451
+ "update_custom_attribute": "/datagovernance/catalog/attributes/{attributeId}",
452
+ "delete_custom_attribute": "/datagovernance/catalog/attributes/{attributeId}",
453
+ },
454
+ # ==================== AZURE RESOURCE MANAGER ENDPOINTS ====================
455
+ "management": {
456
+ # Azure Resource Manager endpoints for Purview accounts
457
+ "operations": "/providers/Microsoft.Purview/operations",
458
+ "check_name_availability": "/subscriptions/{subscriptionId}/providers/Microsoft.Purview/checkNameAvailability",
459
+ "accounts": "/subscriptions/{subscriptionId}/providers/Microsoft.Purview/accounts",
460
+ "accounts_by_rg": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts",
461
+ "account": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}",
462
+ "private_endpoints": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections",
463
+ "default_account": "/subscriptions/{subscriptionId}/providers/Microsoft.Purview/getDefaultAccount",
464
+ "set_default_account": "/subscriptions/{subscriptionId}/providers/Microsoft.Purview/setDefaultAccount",
465
+ "remove_default_account": "/subscriptions/{subscriptionId}/providers/Microsoft.Purview/removeDefaultAccount",
466
+ },
467
+ # ==================== LEGACY COMPATIBILITY ENDPOINTS ====================
468
+ "scan": {
469
+ # Legacy scan endpoints for compatibility
470
+ "base": "/scan",
471
+ "status": "/scan/status",
472
+ "results": "/scan/results",
473
+ },
474
+ "share": {
475
+ # Legacy share endpoints for compatibility
476
+ "base": "/share",
477
+ "invitation": "/share/invitation",
478
+ "accept": "/share/accept",
479
+ },
480
+ }
481
+
482
+
483
+ def format_endpoint(endpoint_template: str, **kwargs) -> str:
484
+ """
485
+ Format an endpoint template with the provided keyword arguments.
486
+
487
+ Args:
488
+ endpoint_template: The endpoint template string with placeholders
489
+ **kwargs: Keyword arguments to substitute in the template
490
+
491
+ Returns:
492
+ The formatted endpoint string
493
+ """
494
+ return endpoint_template.format(**kwargs)
495
+
496
+
497
+ def get_api_version_params(api_type: str = "datamap") -> dict:
498
+ """
499
+ Get API version parameters for the specified API type.
500
+
501
+ Args:
502
+ api_type: The type of API (datamap, account, scanning, workflow, etc.)
503
+
504
+ Returns:
505
+ Dictionary containing the API version parameter
506
+ """
507
+ version_map = {
508
+ "datamap": DATAMAP_API_VERSION,
509
+ "account": ACCOUNT_API_VERSION,
510
+ "collections": ACCOUNT_API_VERSION,
511
+ "scanning": SCANNING_API_VERSION,
512
+ "workflow": WORKFLOW_API_VERSION,
513
+ "devops_policies": get_api_version("devops_policies"),
514
+ "self_service_policies": get_api_version("self_service_policies"),
515
+ "sharing": get_api_version("sharing"),
516
+ "metadata_policies": get_api_version("metadata_policies"),
517
+ "management": "2021-07-01", # ARM API version
518
+ }
519
+
520
+ api_version = version_map.get(api_type, DATAMAP_API_VERSION)
521
+ return {"api-version": api_version}
522
+
523
+
524
+ def get_endpoint_category(endpoint_name: str) -> str:
525
+ """
526
+ Get the API category for an endpoint to determine correct API version.
527
+
528
+ Args:
529
+ endpoint_name: The name of the endpoint
530
+
531
+ Returns:
532
+ The API category (datamap, account, scanning, etc.)
533
+ """
534
+ category_map = {
535
+ "entity": "datamap",
536
+ "glossary": "datamap",
537
+ "types": "datamap",
538
+ "lineage": "datamap",
539
+ "relationship": "datamap",
540
+ "discovery": "datamap",
541
+ "search": "datamap",
542
+ "account": "account",
543
+ "collections": "account",
544
+ "scanning": "scanning",
545
+ "workflow": "workflow",
546
+ "devops_policies": "devops_policies",
547
+ "self_service_policies": "self_service_policies",
548
+ "sharing": "sharing",
549
+ "metadata_policies": "metadata_policies",
550
+ "unified_catalog": "datamap",
551
+ "management": "management",
552
+ }
553
+
554
+ return category_map.get(endpoint_name, "datamap")
@@ -0,0 +1,38 @@
1
+ """
2
+ Custom exceptions for Purview CLI
3
+ """
4
+
5
+ class PurviewClientError(Exception):
6
+ """Base exception class for Purview client errors"""
7
+ pass
8
+
9
+ class PurviewAuthenticationError(PurviewClientError):
10
+ """Exception raised for authentication errors"""
11
+ pass
12
+
13
+ class PurviewAPIError(PurviewClientError):
14
+ """Exception raised for API errors"""
15
+ def __init__(self, message, status_code=None, response_data=None):
16
+ super().__init__(message)
17
+ self.status_code = status_code
18
+ self.response_data = response_data
19
+
20
+ class PurviewConfigurationError(PurviewClientError):
21
+ """Exception raised for configuration errors"""
22
+ pass
23
+
24
+ class PurviewValidationError(PurviewClientError):
25
+ """Exception raised for validation errors"""
26
+ pass
27
+
28
+ class PurviewBulkOperationError(PurviewClientError):
29
+ """Exception raised for bulk operation errors"""
30
+ def __init__(self, message, failed_operations=None):
31
+ super().__init__(message)
32
+ self.failed_operations = failed_operations or []
33
+
34
+ class PurviewRateLimitError(PurviewClientError):
35
+ """Exception raised when rate limit is exceeded"""
36
+ def __init__(self, message, retry_after=None):
37
+ super().__init__(message)
38
+ self.retry_after = retry_after