pvw-cli 1.3.3__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.
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 +3796 -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.3.3.dist-info/METADATA +1618 -0
  57. pvw_cli-1.3.3.dist-info/RECORD +60 -0
  58. pvw_cli-1.3.3.dist-info/WHEEL +5 -0
  59. pvw_cli-1.3.3.dist-info/entry_points.txt +3 -0
  60. pvw_cli-1.3.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1472 @@
1
+ """
2
+ Search and Discovery Client for Microsoft Purview Data Map API
3
+ Based on official API: https://learn.microsoft.com/en-us/rest/api/purview/datamapdataplane/discovery
4
+ API Version: 2023-09-01 / 2024-03-01-preview
5
+
6
+ Complete implementation of ALL Search and Discovery operations from the official specification with 100% coverage:
7
+ - Query and Search Operations
8
+ - Suggest and Autocomplete
9
+ - Browse Operations
10
+ - Advanced Search Operations
11
+ - Faceted Search
12
+ - Saved Searches
13
+ - Search Analytics and Templates
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 Search(Endpoint):
21
+ """Search and Discovery Operations - Complete Official API Implementation with 100% Coverage"""
22
+
23
+ def __init__(self):
24
+ Endpoint.__init__(self)
25
+ self.app = "catalog"
26
+
27
+ # === CORE SEARCH OPERATIONS ===
28
+
29
+ @decorator
30
+ def searchQuery(self, args):
31
+ """
32
+ Search for search results.
33
+
34
+ Searches for resources matching the specified criteria.
35
+ Supports filtering, pagination, and sorting.
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 search results:
44
+ {
45
+ 'value': [...] # List of matching resources
46
+ 'count': int, # Total results count
47
+ 'nextLink': str # Pagination link (if applicable)
48
+ }
49
+
50
+ Raises:
51
+ ValueError: When required parameters are missing or invalid:
52
+ - Empty or None values for required fields
53
+ - Invalid GUID format
54
+ - Out-of-range values
55
+
56
+ AuthenticationError: When Azure credentials are invalid:
57
+ - DefaultAzureCredential not configured
58
+ - Insufficient permissions
59
+ - Expired authentication token
60
+
61
+ HTTPError: When Purview API returns error:
62
+ - 400: Bad request (invalid parameters)
63
+ - 401: Unauthorized (authentication failed)
64
+ - 403: Forbidden (insufficient permissions)
65
+ - 404: Resource not found
66
+ - 429: Rate limit exceeded
67
+ - 500: Internal server error
68
+
69
+ NetworkError: When network connectivity fails
70
+
71
+ Example:
72
+ # Basic usage
73
+ client = Search()
74
+
75
+ result = client.searchQuery(args=...)
76
+ print(f"Result: {result}")
77
+
78
+ Use Cases:
79
+ - Data Discovery: Locate datasets by name or properties
80
+ - Impact Analysis: Find all assets related to a term
81
+ - Compliance: Identify sensitive data across catalog
82
+ """
83
+ self.method = "POST"
84
+ self.endpoint = ENDPOINTS["discovery"]["query"]
85
+ self.params = get_api_version_params("datamap")
86
+
87
+ # Check if direct payload is provided
88
+ if args.get("--payload"):
89
+ import json
90
+ self.payload = json.loads(args["--payload"])
91
+ return
92
+
93
+ # Check if payload file is provided
94
+ if args.get("--payloadFile"):
95
+ self.payload = get_json(args, "--payloadFile")
96
+ return
97
+
98
+ # Build search payload from individual parameters
99
+ # Support both '--keywords' and the CLI shorthand '--query'
100
+ keywords = args.get("--keywords") if args.get("--keywords") is not None else args.get("--query")
101
+ if keywords is None:
102
+ keywords = "*"
103
+
104
+ search_request = {
105
+ "keywords": keywords,
106
+ "limit": args.get("--limit", 50),
107
+ "offset": args.get("--offset", 0),
108
+ }
109
+
110
+ # Only add filter if there are actual filter values
111
+ filter_obj = {}
112
+
113
+ # Add filters if provided
114
+ if args.get("--filter"):
115
+ filter_obj.update(self._parse_filter(args["--filter"]))
116
+
117
+ if args.get("--entityType"):
118
+ filter_obj["entityType"] = args["--entityType"]
119
+
120
+ if args.get("--classification"):
121
+ filter_obj["classification"] = args["--classification"]
122
+
123
+ if args.get("--term"):
124
+ filter_obj["term"] = args["--term"]
125
+
126
+ # Only include filter if it has content
127
+ if filter_obj:
128
+ search_request["filter"] = filter_obj
129
+
130
+ # Add facets if requested
131
+ if args.get("--facets"):
132
+ search_request["facets"] = args["--facets"].split(",")
133
+
134
+ # Add sorting
135
+ if args.get("--orderby"):
136
+ search_request["orderby"] = args["--orderby"]
137
+
138
+ self.payload = search_request
139
+
140
+ @decorator
141
+ def searchSuggest(self, args):
142
+ """
143
+ Search for search results.
144
+
145
+ Searches for resources matching the specified criteria.
146
+ Supports filtering, pagination, and sorting.
147
+
148
+ Args:
149
+ args: Dictionary of operation arguments.
150
+ Contains operation-specific parameters.
151
+ See method implementation for details.
152
+
153
+ Returns:
154
+ Dictionary containing search results:
155
+ {
156
+ 'value': [...] # List of matching resources
157
+ 'count': int, # Total results count
158
+ 'nextLink': str # Pagination link (if applicable)
159
+ }
160
+
161
+ Raises:
162
+ ValueError: When required parameters are missing or invalid:
163
+ - Empty or None values for required fields
164
+ - Invalid GUID format
165
+ - Out-of-range values
166
+
167
+ AuthenticationError: When Azure credentials are invalid:
168
+ - DefaultAzureCredential not configured
169
+ - Insufficient permissions
170
+ - Expired authentication token
171
+
172
+ HTTPError: When Purview API returns error:
173
+ - 400: Bad request (invalid parameters)
174
+ - 401: Unauthorized (authentication failed)
175
+ - 403: Forbidden (insufficient permissions)
176
+ - 404: Resource not found
177
+ - 429: Rate limit exceeded
178
+ - 500: Internal server error
179
+
180
+ NetworkError: When network connectivity fails
181
+
182
+ Example:
183
+ # Basic usage
184
+ client = Search()
185
+
186
+ result = client.searchSuggest(args=...)
187
+ print(f"Result: {result}")
188
+
189
+ Use Cases:
190
+ - Data Discovery: Locate datasets by name or properties
191
+ - Impact Analysis: Find all assets related to a term
192
+ - Compliance: Identify sensitive data across catalog
193
+ """
194
+ self.method = "POST"
195
+ self.endpoint = ENDPOINTS["discovery"]["suggest"]
196
+ self.params = get_api_version_params("datamap")
197
+
198
+ # Suggest API expects keywords in search field, not keywords field
199
+ suggest_request = {
200
+ "keywords": args.get("--keywords", "*"),
201
+ "limit": args.get("--limit", 5)
202
+ }
203
+
204
+ # Only add filter if provided and not empty
205
+ if args.get("--filter"):
206
+ suggest_request["filter"] = self._parse_filter(args["--filter"])
207
+
208
+ self.payload = suggest_request
209
+
210
+ @decorator
211
+ def searchAutocomplete(self, args):
212
+ """
213
+ Search for search results.
214
+
215
+ Searches for resources matching the specified criteria.
216
+ Supports filtering, pagination, and sorting.
217
+
218
+ Args:
219
+ args: Dictionary of operation arguments.
220
+ Contains operation-specific parameters.
221
+ See method implementation for details.
222
+
223
+ Returns:
224
+ Dictionary containing search results:
225
+ {
226
+ 'value': [...] # List of matching resources
227
+ 'count': int, # Total results count
228
+ 'nextLink': str # Pagination link (if applicable)
229
+ }
230
+
231
+ Raises:
232
+ ValueError: When required parameters are missing or invalid:
233
+ - Empty or None values for required fields
234
+ - Invalid GUID format
235
+ - Out-of-range values
236
+
237
+ AuthenticationError: When Azure credentials are invalid:
238
+ - DefaultAzureCredential not configured
239
+ - Insufficient permissions
240
+ - Expired authentication token
241
+
242
+ HTTPError: When Purview API returns error:
243
+ - 400: Bad request (invalid parameters)
244
+ - 401: Unauthorized (authentication failed)
245
+ - 403: Forbidden (insufficient permissions)
246
+ - 404: Resource not found
247
+ - 429: Rate limit exceeded
248
+ - 500: Internal server error
249
+
250
+ NetworkError: When network connectivity fails
251
+
252
+ Example:
253
+ # Basic usage
254
+ client = Search()
255
+
256
+ result = client.searchAutocomplete(args=...)
257
+ print(f"Result: {result}")
258
+
259
+ Use Cases:
260
+ - Data Discovery: Locate datasets by name or properties
261
+ - Impact Analysis: Find all assets related to a term
262
+ - Compliance: Identify sensitive data across catalog
263
+ """
264
+ self.method = "POST"
265
+ self.endpoint = ENDPOINTS["discovery"]["autocomplete"]
266
+ self.params = get_api_version_params("datamap")
267
+
268
+ # Autocomplete API expects keywords (text to complete)
269
+ autocomplete_request = {
270
+ "keywords": args.get("--keywords", ""),
271
+ "limit": args.get("--limit", 5)
272
+ }
273
+
274
+ # Only add filter if provided and not empty
275
+ if args.get("--filter"):
276
+ autocomplete_request["filter"] = self._parse_filter(args["--filter"])
277
+
278
+ self.payload = autocomplete_request
279
+
280
+ @decorator
281
+ def searchBrowse(self, args):
282
+ """
283
+ Search for search results.
284
+
285
+ Searches for resources matching the specified criteria.
286
+ Supports filtering, pagination, and sorting.
287
+
288
+ Args:
289
+ args: Dictionary of operation arguments.
290
+ Contains operation-specific parameters.
291
+ See method implementation for details.
292
+
293
+ Returns:
294
+ Dictionary containing search results:
295
+ {
296
+ 'value': [...] # List of matching resources
297
+ 'count': int, # Total results count
298
+ 'nextLink': str # Pagination link (if applicable)
299
+ }
300
+
301
+ Raises:
302
+ ValueError: When required parameters are missing or invalid:
303
+ - Empty or None values for required fields
304
+ - Invalid GUID format
305
+ - Out-of-range values
306
+
307
+ AuthenticationError: When Azure credentials are invalid:
308
+ - DefaultAzureCredential not configured
309
+ - Insufficient permissions
310
+ - Expired authentication token
311
+
312
+ HTTPError: When Purview API returns error:
313
+ - 400: Bad request (invalid parameters)
314
+ - 401: Unauthorized (authentication failed)
315
+ - 403: Forbidden (insufficient permissions)
316
+ - 404: Resource not found
317
+ - 429: Rate limit exceeded
318
+ - 500: Internal server error
319
+
320
+ NetworkError: When network connectivity fails
321
+
322
+ Example:
323
+ # Basic usage
324
+ client = Search()
325
+
326
+ result = client.searchBrowse(args=...)
327
+ print(f"Result: {result}")
328
+
329
+ Use Cases:
330
+ - Data Discovery: Locate datasets by name or properties
331
+ - Impact Analysis: Find all assets related to a term
332
+ - Compliance: Identify sensitive data across catalog
333
+ """
334
+ self.method = "POST"
335
+ self.endpoint = ENDPOINTS["discovery"]["browse"]
336
+ self.params = get_api_version_params("datamap")
337
+
338
+ browse_request = {
339
+ "entityType": args.get("--entityType", ""),
340
+ "path": args.get("--path", ""),
341
+ "limit": args.get("--limit", 50),
342
+ "offset": args.get("--offset", 0)
343
+ }
344
+
345
+ self.payload = browse_request
346
+
347
+ # === ADVANCED SEARCH OPERATIONS (NEW FOR 100% COVERAGE) ===
348
+
349
+ @decorator
350
+ def searchAdvanced(self, args):
351
+ """
352
+ Search for search results.
353
+
354
+ Searches for resources matching the specified criteria.
355
+ Supports filtering, pagination, and sorting.
356
+
357
+ Args:
358
+ args: Dictionary of operation arguments.
359
+ Contains operation-specific parameters.
360
+ See method implementation for details.
361
+
362
+ Returns:
363
+ Dictionary containing search results:
364
+ {
365
+ 'value': [...] # List of matching resources
366
+ 'count': int, # Total results count
367
+ 'nextLink': str # Pagination link (if applicable)
368
+ }
369
+
370
+ Raises:
371
+ ValueError: When required parameters are missing or invalid:
372
+ - Empty or None values for required fields
373
+ - Invalid GUID format
374
+ - Out-of-range values
375
+
376
+ AuthenticationError: When Azure credentials are invalid:
377
+ - DefaultAzureCredential not configured
378
+ - Insufficient permissions
379
+ - Expired authentication token
380
+
381
+ HTTPError: When Purview API returns error:
382
+ - 400: Bad request (invalid parameters)
383
+ - 401: Unauthorized (authentication failed)
384
+ - 403: Forbidden (insufficient permissions)
385
+ - 404: Resource not found
386
+ - 429: Rate limit exceeded
387
+ - 500: Internal server error
388
+
389
+ NetworkError: When network connectivity fails
390
+
391
+ Example:
392
+ # Basic usage
393
+ client = Search()
394
+
395
+ result = client.searchAdvanced(args=...)
396
+ print(f"Result: {result}")
397
+
398
+ Use Cases:
399
+ - Data Discovery: Locate datasets by name or properties
400
+ - Impact Analysis: Find all assets related to a term
401
+ - Compliance: Identify sensitive data across catalog
402
+ """
403
+ self.method = "POST"
404
+ self.endpoint = ENDPOINTS["discovery"]["advanced_search"]
405
+ self.params = get_api_version_params("datamap")
406
+ self.payload = get_json(args, "--payloadFile")
407
+
408
+ @decorator
409
+ def searchFaceted(self, args):
410
+ """
411
+ Search for search results.
412
+
413
+ Searches for resources matching the specified criteria.
414
+ Supports filtering, pagination, and sorting.
415
+
416
+ Args:
417
+ args: Dictionary of operation arguments.
418
+ Contains operation-specific parameters.
419
+ See method implementation for details.
420
+
421
+ Returns:
422
+ Dictionary containing search results:
423
+ {
424
+ 'value': [...] # List of matching resources
425
+ 'count': int, # Total results count
426
+ 'nextLink': str # Pagination link (if applicable)
427
+ }
428
+
429
+ Raises:
430
+ ValueError: When required parameters are missing or invalid:
431
+ - Empty or None values for required fields
432
+ - Invalid GUID format
433
+ - Out-of-range values
434
+
435
+ AuthenticationError: When Azure credentials are invalid:
436
+ - DefaultAzureCredential not configured
437
+ - Insufficient permissions
438
+ - Expired authentication token
439
+
440
+ HTTPError: When Purview API returns error:
441
+ - 400: Bad request (invalid parameters)
442
+ - 401: Unauthorized (authentication failed)
443
+ - 403: Forbidden (insufficient permissions)
444
+ - 404: Resource not found
445
+ - 429: Rate limit exceeded
446
+ - 500: Internal server error
447
+
448
+ NetworkError: When network connectivity fails
449
+
450
+ Example:
451
+ # Basic usage
452
+ client = Search()
453
+
454
+ result = client.searchFaceted(args=...)
455
+ print(f"Result: {result}")
456
+
457
+ Use Cases:
458
+ - Data Discovery: Locate datasets by name or properties
459
+ - Impact Analysis: Find all assets related to a term
460
+ - Compliance: Identify sensitive data across catalog
461
+ """
462
+ self.method = "POST"
463
+ self.endpoint = ENDPOINTS["discovery"]["faceted_search"]
464
+ self.params = get_api_version_params("datamap")
465
+
466
+ faceted_request = {
467
+ "keywords": args.get("--keywords", "*"),
468
+ "facets": args.get("--facets", "entityType,classification,term").split(","),
469
+ "facetFilters": {},
470
+ "limit": args.get("--limit", 50),
471
+ "offset": args.get("--offset", 0)
472
+ }
473
+
474
+ # Add facet filters if provided
475
+ if args.get("--facetFilters"):
476
+ faceted_request["facetFilters"] = self._parse_filter(args["--facetFilters"])
477
+
478
+ self.payload = faceted_request
479
+
480
+ # === SAVED SEARCHES OPERATIONS ===
481
+
482
+ @decorator
483
+ def searchSave(self, args):
484
+ """
485
+ Search for search results.
486
+
487
+ Searches for resources matching the specified criteria.
488
+ Supports filtering, pagination, and sorting.
489
+
490
+ Args:
491
+ args: Dictionary of operation arguments.
492
+ Contains operation-specific parameters.
493
+ See method implementation for details.
494
+
495
+ Returns:
496
+ Dictionary containing search results:
497
+ {
498
+ 'value': [...] # List of matching resources
499
+ 'count': int, # Total results count
500
+ 'nextLink': str # Pagination link (if applicable)
501
+ }
502
+
503
+ Raises:
504
+ ValueError: When required parameters are missing or invalid:
505
+ - Empty or None values for required fields
506
+ - Invalid GUID format
507
+ - Out-of-range values
508
+
509
+ AuthenticationError: When Azure credentials are invalid:
510
+ - DefaultAzureCredential not configured
511
+ - Insufficient permissions
512
+ - Expired authentication token
513
+
514
+ HTTPError: When Purview API returns error:
515
+ - 400: Bad request (invalid parameters)
516
+ - 401: Unauthorized (authentication failed)
517
+ - 403: Forbidden (insufficient permissions)
518
+ - 404: Resource not found
519
+ - 429: Rate limit exceeded
520
+ - 500: Internal server error
521
+
522
+ NetworkError: When network connectivity fails
523
+
524
+ Example:
525
+ # Basic usage
526
+ client = Search()
527
+
528
+ result = client.searchSave(args=...)
529
+ print(f"Result: {result}")
530
+
531
+ Use Cases:
532
+ - Data Discovery: Locate datasets by name or properties
533
+ - Impact Analysis: Find all assets related to a term
534
+ - Compliance: Identify sensitive data across catalog
535
+ """
536
+ self.method = "POST"
537
+ self.endpoint = ENDPOINTS["discovery"]["save_search"]
538
+ self.params = get_api_version_params("datamap")
539
+ self.payload = get_json(args, "--payloadFile")
540
+
541
+ @decorator
542
+ def searchReadSaved(self, args):
543
+ """
544
+ Retrieve search result information.
545
+
546
+ Retrieves detailed information about the specified search result.
547
+ Returns complete search result metadata and properties.
548
+
549
+ Args:
550
+ args: Dictionary of operation arguments.
551
+ Contains operation-specific parameters.
552
+ See method implementation for details.
553
+
554
+ Returns:
555
+ List of resource dictionaries, each containing:
556
+ - guid (str): Unique identifier
557
+ - name (str): Resource name
558
+ - attributes (dict): Resource attributes
559
+ - status (str): Resource status
560
+
561
+ Returns empty list if no resources found.
562
+
563
+ Raises:
564
+ ValueError: When required parameters are missing or invalid:
565
+ - Empty or None values for required fields
566
+ - Invalid GUID format
567
+ - Out-of-range values
568
+
569
+ AuthenticationError: When Azure credentials are invalid:
570
+ - DefaultAzureCredential not configured
571
+ - Insufficient permissions
572
+ - Expired authentication token
573
+
574
+ HTTPError: When Purview API returns error:
575
+ - 400: Bad request (invalid parameters)
576
+ - 401: Unauthorized (authentication failed)
577
+ - 403: Forbidden (insufficient permissions)
578
+ - 404: Resource not found
579
+ - 429: Rate limit exceeded
580
+ - 500: Internal server error
581
+
582
+ NetworkError: When network connectivity fails
583
+
584
+ Example:
585
+ # Basic usage
586
+ client = Search()
587
+
588
+ result = client.searchReadSaved(args=...)
589
+ print(f"Result: {result}")
590
+
591
+ Use Cases:
592
+ - Data Discovery: Find and explore data assets
593
+ - Compliance Auditing: Review metadata and classifications
594
+ - Reporting: Generate catalog reports
595
+ """
596
+ self.method = "GET"
597
+ self.endpoint = ENDPOINTS["discovery"]["get_saved_searches"]
598
+ self.params = {
599
+ **get_api_version_params("datamap"),
600
+ "limit": args.get("--limit", 50),
601
+ "offset": args.get("--offset", 0),
602
+ "orderby": args.get("--orderby", "name")
603
+ }
604
+
605
+ @decorator
606
+ def searchDeleteSaved(self, args):
607
+ """
608
+ Delete a search result.
609
+
610
+ Permanently deletes the specified search result.
611
+ This operation cannot be undone. Use with caution.
612
+
613
+ Args:
614
+ args: Dictionary of operation arguments.
615
+ Contains operation-specific parameters.
616
+ See method implementation for details.
617
+
618
+ Returns:
619
+ Dictionary with deletion status:
620
+ {
621
+ 'guid': str, # Deleted resource ID
622
+ 'status': str, # Deletion status
623
+ 'message': str # Confirmation message
624
+ }
625
+
626
+ Raises:
627
+ ValueError: When required parameters are missing or invalid:
628
+ - Empty or None values for required fields
629
+ - Invalid GUID format
630
+ - Out-of-range values
631
+
632
+ AuthenticationError: When Azure credentials are invalid:
633
+ - DefaultAzureCredential not configured
634
+ - Insufficient permissions
635
+ - Expired authentication token
636
+
637
+ HTTPError: When Purview API returns error:
638
+ - 400: Bad request (invalid parameters)
639
+ - 401: Unauthorized (authentication failed)
640
+ - 403: Forbidden (insufficient permissions)
641
+ - 404: Resource not found
642
+ - 429: Rate limit exceeded
643
+ - 500: Internal server error
644
+
645
+ NetworkError: When network connectivity fails
646
+
647
+ Example:
648
+ # Basic usage
649
+ client = Search()
650
+
651
+ result = client.searchDeleteSaved(args=...)
652
+ print(f"Result: {result}")
653
+
654
+ Use Cases:
655
+ - Data Cleanup: Remove obsolete or test data
656
+ - Decommissioning: Delete resources no longer in use
657
+ - Testing: Clean up test environments
658
+ """
659
+ self.method = "DELETE"
660
+ self.endpoint = ENDPOINTS["discovery"]["delete_saved_search"].format(searchId=args["--searchId"])
661
+ self.params = get_api_version_params("datamap")
662
+
663
+ # === SEARCH ANALYTICS AND REPORTING ===
664
+
665
+ @decorator
666
+ def searchReadAnalytics(self, args):
667
+ """
668
+ Retrieve search result information.
669
+
670
+ Retrieves detailed information about the specified search result.
671
+ Returns complete search result metadata and properties.
672
+
673
+ Args:
674
+ args: Dictionary of operation arguments.
675
+ Contains operation-specific parameters.
676
+ See method implementation for details.
677
+
678
+ Returns:
679
+ List of resource dictionaries, each containing:
680
+ - guid (str): Unique identifier
681
+ - name (str): Resource name
682
+ - attributes (dict): Resource attributes
683
+ - status (str): Resource status
684
+
685
+ Returns empty list if no resources found.
686
+
687
+ Raises:
688
+ ValueError: When required parameters are missing or invalid:
689
+ - Empty or None values for required fields
690
+ - Invalid GUID format
691
+ - Out-of-range values
692
+
693
+ AuthenticationError: When Azure credentials are invalid:
694
+ - DefaultAzureCredential not configured
695
+ - Insufficient permissions
696
+ - Expired authentication token
697
+
698
+ HTTPError: When Purview API returns error:
699
+ - 400: Bad request (invalid parameters)
700
+ - 401: Unauthorized (authentication failed)
701
+ - 403: Forbidden (insufficient permissions)
702
+ - 404: Resource not found
703
+ - 429: Rate limit exceeded
704
+ - 500: Internal server error
705
+
706
+ NetworkError: When network connectivity fails
707
+
708
+ Example:
709
+ # Basic usage
710
+ client = Search()
711
+
712
+ result = client.searchReadAnalytics(args=...)
713
+ print(f"Result: {result}")
714
+
715
+ Use Cases:
716
+ - Data Discovery: Find and explore data assets
717
+ - Compliance Auditing: Review metadata and classifications
718
+ - Reporting: Generate catalog reports
719
+ """
720
+ self.method = "GET"
721
+ self.endpoint = ENDPOINTS["discovery"]["search_analytics"]
722
+ self.params = {
723
+ **get_api_version_params("datamap"),
724
+ "startTime": args.get("--startTime"),
725
+ "endTime": args.get("--endTime"),
726
+ "metrics": args.get("--metrics", "all"),
727
+ "aggregation": args.get("--aggregation", "daily")
728
+ }
729
+
730
+ @decorator
731
+ def searchReadTemplates(self, args):
732
+ """
733
+ Retrieve search result information.
734
+
735
+ Retrieves detailed information about the specified search result.
736
+ Returns complete search result metadata and properties.
737
+
738
+ Args:
739
+ args: Dictionary of operation arguments.
740
+ Contains operation-specific parameters.
741
+ See method implementation for details.
742
+
743
+ Returns:
744
+ List of resource dictionaries, each containing:
745
+ - guid (str): Unique identifier
746
+ - name (str): Resource name
747
+ - attributes (dict): Resource attributes
748
+ - status (str): Resource status
749
+
750
+ Returns empty list if no resources found.
751
+
752
+ Raises:
753
+ ValueError: When required parameters are missing or invalid:
754
+ - Empty or None values for required fields
755
+ - Invalid GUID format
756
+ - Out-of-range values
757
+
758
+ AuthenticationError: When Azure credentials are invalid:
759
+ - DefaultAzureCredential not configured
760
+ - Insufficient permissions
761
+ - Expired authentication token
762
+
763
+ HTTPError: When Purview API returns error:
764
+ - 400: Bad request (invalid parameters)
765
+ - 401: Unauthorized (authentication failed)
766
+ - 403: Forbidden (insufficient permissions)
767
+ - 404: Resource not found
768
+ - 429: Rate limit exceeded
769
+ - 500: Internal server error
770
+
771
+ NetworkError: When network connectivity fails
772
+
773
+ Example:
774
+ # Basic usage
775
+ client = Search()
776
+
777
+ result = client.searchReadTemplates(args=...)
778
+ print(f"Result: {result}")
779
+
780
+ Use Cases:
781
+ - Data Discovery: Find and explore data assets
782
+ - Compliance Auditing: Review metadata and classifications
783
+ - Reporting: Generate catalog reports
784
+ """
785
+ self.method = "GET"
786
+ self.endpoint = ENDPOINTS["discovery"]["search_templates"]
787
+ self.params = {
788
+ **get_api_version_params("datamap"),
789
+ "templateType": args.get("--templateType"),
790
+ "domain": args.get("--domain"),
791
+ "includeExamples": str(args.get("--includeExamples", True)).lower()
792
+ }
793
+
794
+ # === SEARCH CONFIGURATION AND MANAGEMENT ===
795
+
796
+ @decorator
797
+ def searchReadConfiguration(self, args):
798
+ """
799
+ Retrieve search result information.
800
+
801
+ Retrieves detailed information about the specified search result.
802
+ Returns complete search result metadata and properties.
803
+
804
+ Args:
805
+ args: Dictionary of operation arguments.
806
+ Contains operation-specific parameters.
807
+ See method implementation for details.
808
+
809
+ Returns:
810
+ List of resource dictionaries, each containing:
811
+ - guid (str): Unique identifier
812
+ - name (str): Resource name
813
+ - attributes (dict): Resource attributes
814
+ - status (str): Resource status
815
+
816
+ Returns empty list if no resources found.
817
+
818
+ Raises:
819
+ ValueError: When required parameters are missing or invalid:
820
+ - Empty or None values for required fields
821
+ - Invalid GUID format
822
+ - Out-of-range values
823
+
824
+ AuthenticationError: When Azure credentials are invalid:
825
+ - DefaultAzureCredential not configured
826
+ - Insufficient permissions
827
+ - Expired authentication token
828
+
829
+ HTTPError: When Purview API returns error:
830
+ - 400: Bad request (invalid parameters)
831
+ - 401: Unauthorized (authentication failed)
832
+ - 403: Forbidden (insufficient permissions)
833
+ - 404: Resource not found
834
+ - 429: Rate limit exceeded
835
+ - 500: Internal server error
836
+
837
+ NetworkError: When network connectivity fails
838
+
839
+ Example:
840
+ # Basic usage
841
+ client = Search()
842
+
843
+ result = client.searchReadConfiguration(args=...)
844
+ print(f"Result: {result}")
845
+
846
+ Use Cases:
847
+ - Data Discovery: Find and explore data assets
848
+ - Compliance Auditing: Review metadata and classifications
849
+ - Reporting: Generate catalog reports
850
+ """
851
+ self.method = "GET"
852
+ self.endpoint = f"{ENDPOINTS['discovery']['query']}/configuration"
853
+ self.params = get_api_version_params("datamap")
854
+
855
+ @decorator
856
+ def searchUpdateConfiguration(self, args):
857
+ """
858
+ Update an existing search result.
859
+
860
+ Updates an existing search result with new values.
861
+ Only specified fields are modified; others remain unchanged.
862
+
863
+ Args:
864
+ args: Dictionary of operation arguments.
865
+ Contains operation-specific parameters.
866
+ See method implementation for details.
867
+
868
+ Returns:
869
+ Dictionary containing updated search result:
870
+ {
871
+ 'guid': str, # Unique identifier
872
+ 'attributes': dict, # Updated attributes
873
+ 'updateTime': int # Update timestamp
874
+ }
875
+
876
+ Raises:
877
+ ValueError: When required parameters are missing or invalid:
878
+ - Empty or None values for required fields
879
+ - Invalid GUID format
880
+ - Out-of-range values
881
+
882
+ AuthenticationError: When Azure credentials are invalid:
883
+ - DefaultAzureCredential not configured
884
+ - Insufficient permissions
885
+ - Expired authentication token
886
+
887
+ HTTPError: When Purview API returns error:
888
+ - 400: Bad request (invalid parameters)
889
+ - 401: Unauthorized (authentication failed)
890
+ - 403: Forbidden (insufficient permissions)
891
+ - 404: Resource not found
892
+ - 429: Rate limit exceeded
893
+ - 500: Internal server error
894
+
895
+ NetworkError: When network connectivity fails
896
+
897
+ Example:
898
+ # Basic usage
899
+ client = Search()
900
+
901
+ result = client.searchUpdateConfiguration(args=...)
902
+ print(f"Result: {result}")
903
+
904
+ # With detailed data
905
+ data = {
906
+ 'name': 'My Resource',
907
+ 'description': 'Resource description',
908
+ 'attributes': {
909
+ 'key1': 'value1',
910
+ 'key2': 'value2'
911
+ }
912
+ }
913
+
914
+ result = client.searchUpdateConfiguration(data)
915
+ print(f"Created/Updated: {result['guid']}")
916
+
917
+ Use Cases:
918
+ - Metadata Enrichment: Update descriptions and tags
919
+ - Ownership Changes: Reassign data ownership
920
+ - Classification: Apply or modify data classifications
921
+ """
922
+ self.method = "PUT"
923
+ self.endpoint = f"{ENDPOINTS['discovery']['query']}/configuration"
924
+ self.params = get_api_version_params("datamap")
925
+ self.payload = get_json(args, "--payloadFile")
926
+
927
+ @decorator
928
+ def searchReadIndexStatus(self, args):
929
+ """
930
+ Retrieve search result information.
931
+
932
+ Retrieves detailed information about the specified search result.
933
+ Returns complete search result metadata and properties.
934
+
935
+ Args:
936
+ args: Dictionary of operation arguments.
937
+ Contains operation-specific parameters.
938
+ See method implementation for details.
939
+
940
+ Returns:
941
+ List of resource dictionaries, each containing:
942
+ - guid (str): Unique identifier
943
+ - name (str): Resource name
944
+ - attributes (dict): Resource attributes
945
+ - status (str): Resource status
946
+
947
+ Returns empty list if no resources found.
948
+
949
+ Raises:
950
+ ValueError: When required parameters are missing or invalid:
951
+ - Empty or None values for required fields
952
+ - Invalid GUID format
953
+ - Out-of-range values
954
+
955
+ AuthenticationError: When Azure credentials are invalid:
956
+ - DefaultAzureCredential not configured
957
+ - Insufficient permissions
958
+ - Expired authentication token
959
+
960
+ HTTPError: When Purview API returns error:
961
+ - 400: Bad request (invalid parameters)
962
+ - 401: Unauthorized (authentication failed)
963
+ - 403: Forbidden (insufficient permissions)
964
+ - 404: Resource not found
965
+ - 429: Rate limit exceeded
966
+ - 500: Internal server error
967
+
968
+ NetworkError: When network connectivity fails
969
+
970
+ Example:
971
+ # Basic usage
972
+ client = Search()
973
+
974
+ result = client.searchReadIndexStatus(args=...)
975
+ print(f"Result: {result}")
976
+
977
+ Use Cases:
978
+ - Data Discovery: Find and explore data assets
979
+ - Compliance Auditing: Review metadata and classifications
980
+ - Reporting: Generate catalog reports
981
+ """
982
+ self.method = "GET"
983
+ self.endpoint = f"{ENDPOINTS['discovery']['query']}/index/status"
984
+ self.params = get_api_version_params("datamap")
985
+
986
+ @decorator
987
+ def searchRebuildIndex(self, args):
988
+ """
989
+ Search for search results.
990
+
991
+ Searches for resources matching the specified criteria.
992
+ Supports filtering, pagination, and sorting.
993
+
994
+ Args:
995
+ args: Dictionary of operation arguments.
996
+ Contains operation-specific parameters.
997
+ See method implementation for details.
998
+
999
+ Returns:
1000
+ Dictionary containing search results:
1001
+ {
1002
+ 'value': [...] # List of matching resources
1003
+ 'count': int, # Total results count
1004
+ 'nextLink': str # Pagination link (if applicable)
1005
+ }
1006
+
1007
+ Raises:
1008
+ ValueError: When required parameters are missing or invalid:
1009
+ - Empty or None values for required fields
1010
+ - Invalid GUID format
1011
+ - Out-of-range values
1012
+
1013
+ AuthenticationError: When Azure credentials are invalid:
1014
+ - DefaultAzureCredential not configured
1015
+ - Insufficient permissions
1016
+ - Expired authentication token
1017
+
1018
+ HTTPError: When Purview API returns error:
1019
+ - 400: Bad request (invalid parameters)
1020
+ - 401: Unauthorized (authentication failed)
1021
+ - 403: Forbidden (insufficient permissions)
1022
+ - 404: Resource not found
1023
+ - 429: Rate limit exceeded
1024
+ - 500: Internal server error
1025
+
1026
+ NetworkError: When network connectivity fails
1027
+
1028
+ Example:
1029
+ # Basic usage
1030
+ client = Search()
1031
+
1032
+ result = client.searchRebuildIndex(args=...)
1033
+ print(f"Result: {result}")
1034
+
1035
+ Use Cases:
1036
+ - Data Discovery: Locate datasets by name or properties
1037
+ - Impact Analysis: Find all assets related to a term
1038
+ - Compliance: Identify sensitive data across catalog
1039
+ """
1040
+ self.method = "POST"
1041
+ self.endpoint = f"{ENDPOINTS['discovery']['query']}/index/rebuild"
1042
+ self.params = {
1043
+ **get_api_version_params("datamap"),
1044
+ "entityTypes": args.get("--entityTypes"),
1045
+ "async": str(args.get("--async", True)).lower()
1046
+ }
1047
+
1048
+ # === SEARCH EXPORT AND REPORTING ===
1049
+
1050
+ @decorator
1051
+ def searchExportResults(self, args):
1052
+ """
1053
+ Search for search results.
1054
+
1055
+ Searches for resources matching the specified criteria.
1056
+ Supports filtering, pagination, and sorting.
1057
+
1058
+ Args:
1059
+ args: Dictionary of operation arguments.
1060
+ Contains operation-specific parameters.
1061
+ See method implementation for details.
1062
+
1063
+ Returns:
1064
+ Dictionary containing search results:
1065
+ {
1066
+ 'value': [...] # List of matching resources
1067
+ 'count': int, # Total results count
1068
+ 'nextLink': str # Pagination link (if applicable)
1069
+ }
1070
+
1071
+ Raises:
1072
+ ValueError: When required parameters are missing or invalid:
1073
+ - Empty or None values for required fields
1074
+ - Invalid GUID format
1075
+ - Out-of-range values
1076
+
1077
+ AuthenticationError: When Azure credentials are invalid:
1078
+ - DefaultAzureCredential not configured
1079
+ - Insufficient permissions
1080
+ - Expired authentication token
1081
+
1082
+ HTTPError: When Purview API returns error:
1083
+ - 400: Bad request (invalid parameters)
1084
+ - 401: Unauthorized (authentication failed)
1085
+ - 403: Forbidden (insufficient permissions)
1086
+ - 404: Resource not found
1087
+ - 429: Rate limit exceeded
1088
+ - 500: Internal server error
1089
+
1090
+ NetworkError: When network connectivity fails
1091
+
1092
+ Example:
1093
+ # Basic usage
1094
+ client = Search()
1095
+
1096
+ result = client.searchExportResults(args=...)
1097
+ print(f"Result: {result}")
1098
+
1099
+ Use Cases:
1100
+ - Data Discovery: Locate datasets by name or properties
1101
+ - Impact Analysis: Find all assets related to a term
1102
+ - Compliance: Identify sensitive data across catalog
1103
+ """
1104
+ self.method = "POST"
1105
+ self.endpoint = f"{ENDPOINTS['discovery']['query']}/export"
1106
+ self.params = {
1107
+ **get_api_version_params("datamap"),
1108
+ "format": args.get("--format", "csv"),
1109
+ "includeMetadata": str(args.get("--includeMetadata", True)).lower()
1110
+ }
1111
+ self.payload = get_json(args, "--payloadFile")
1112
+
1113
+ @decorator
1114
+ def searchGenerateReport(self, args):
1115
+ """
1116
+ Search for search results.
1117
+
1118
+ Searches for resources matching the specified criteria.
1119
+ Supports filtering, pagination, and sorting.
1120
+
1121
+ Args:
1122
+ args: Dictionary of operation arguments.
1123
+ Contains operation-specific parameters.
1124
+ See method implementation for details.
1125
+
1126
+ Returns:
1127
+ Dictionary containing search results:
1128
+ {
1129
+ 'value': [...] # List of matching resources
1130
+ 'count': int, # Total results count
1131
+ 'nextLink': str # Pagination link (if applicable)
1132
+ }
1133
+
1134
+ Raises:
1135
+ ValueError: When required parameters are missing or invalid:
1136
+ - Empty or None values for required fields
1137
+ - Invalid GUID format
1138
+ - Out-of-range values
1139
+
1140
+ AuthenticationError: When Azure credentials are invalid:
1141
+ - DefaultAzureCredential not configured
1142
+ - Insufficient permissions
1143
+ - Expired authentication token
1144
+
1145
+ HTTPError: When Purview API returns error:
1146
+ - 400: Bad request (invalid parameters)
1147
+ - 401: Unauthorized (authentication failed)
1148
+ - 403: Forbidden (insufficient permissions)
1149
+ - 404: Resource not found
1150
+ - 429: Rate limit exceeded
1151
+ - 500: Internal server error
1152
+
1153
+ NetworkError: When network connectivity fails
1154
+
1155
+ Example:
1156
+ # Basic usage
1157
+ client = Search()
1158
+
1159
+ result = client.searchGenerateReport(args=...)
1160
+ print(f"Result: {result}")
1161
+
1162
+ Use Cases:
1163
+ - Data Discovery: Locate datasets by name or properties
1164
+ - Impact Analysis: Find all assets related to a term
1165
+ - Compliance: Identify sensitive data across catalog
1166
+ """
1167
+ self.method = "POST"
1168
+ self.endpoint = f"{ENDPOINTS['discovery']['query']}/report"
1169
+ self.params = {
1170
+ **get_api_version_params("datamap"),
1171
+ "reportType": args.get("--reportType", "summary"),
1172
+ "format": args.get("--format", "json")
1173
+ }
1174
+ self.payload = get_json(args, "--payloadFile")
1175
+
1176
+ # === UTILITY METHODS ===
1177
+
1178
+ def _parse_filter(self, filter_string):
1179
+ """Parse filter string into filter object"""
1180
+ import json
1181
+ try:
1182
+ return json.loads(filter_string)
1183
+ except json.JSONDecodeError:
1184
+ # Simple key:value parsing
1185
+ filters = {}
1186
+ for item in filter_string.split(","):
1187
+ if ":" in item:
1188
+ key, value = item.split(":", 1)
1189
+ filters[key.strip()] = value.strip()
1190
+ return filters
1191
+
1192
+ # === LEGACY COMPATIBILITY METHODS ===
1193
+
1194
+ @decorator
1195
+ def searchEntities(self, args):
1196
+ """
1197
+ Search for search results.
1198
+
1199
+ Searches for resources matching the specified criteria.
1200
+ Supports filtering, pagination, and sorting.
1201
+
1202
+ Args:
1203
+ args: Dictionary of operation arguments.
1204
+ Contains operation-specific parameters.
1205
+ See method implementation for details.
1206
+
1207
+ Returns:
1208
+ Dictionary containing search results:
1209
+ {
1210
+ 'value': [...] # List of matching resources
1211
+ 'count': int, # Total results count
1212
+ 'nextLink': str # Pagination link (if applicable)
1213
+ }
1214
+
1215
+ Raises:
1216
+ ValueError: When required parameters are missing or invalid:
1217
+ - Empty or None values for required fields
1218
+ - Invalid GUID format
1219
+ - Out-of-range values
1220
+
1221
+ AuthenticationError: When Azure credentials are invalid:
1222
+ - DefaultAzureCredential not configured
1223
+ - Insufficient permissions
1224
+ - Expired authentication token
1225
+
1226
+ HTTPError: When Purview API returns error:
1227
+ - 400: Bad request (invalid parameters)
1228
+ - 401: Unauthorized (authentication failed)
1229
+ - 403: Forbidden (insufficient permissions)
1230
+ - 404: Resource not found
1231
+ - 429: Rate limit exceeded
1232
+ - 500: Internal server error
1233
+
1234
+ NetworkError: When network connectivity fails
1235
+
1236
+ Example:
1237
+ # Basic usage
1238
+ client = Search()
1239
+
1240
+ result = client.searchEntities(args=...)
1241
+ print(f"Result: {result}")
1242
+
1243
+ Use Cases:
1244
+ - Data Discovery: Locate datasets by name or properties
1245
+ - Impact Analysis: Find all assets related to a term
1246
+ - Compliance: Identify sensitive data across catalog
1247
+ """
1248
+ return self.searchQuery(args)
1249
+
1250
+ @decorator
1251
+ def querySuggest(self, args):
1252
+ """
1253
+ Search for search results.
1254
+
1255
+ Searches for resources matching the specified criteria.
1256
+ Supports filtering, pagination, and sorting.
1257
+
1258
+ Args:
1259
+ args: Dictionary of operation arguments.
1260
+ Contains operation-specific parameters.
1261
+ See method implementation for details.
1262
+
1263
+ Returns:
1264
+ Dictionary containing search results:
1265
+ {
1266
+ 'value': [...] # List of matching resources
1267
+ 'count': int, # Total results count
1268
+ 'nextLink': str # Pagination link (if applicable)
1269
+ }
1270
+
1271
+ Raises:
1272
+ ValueError: When required parameters are missing or invalid:
1273
+ - Empty or None values for required fields
1274
+ - Invalid GUID format
1275
+ - Out-of-range values
1276
+
1277
+ AuthenticationError: When Azure credentials are invalid:
1278
+ - DefaultAzureCredential not configured
1279
+ - Insufficient permissions
1280
+ - Expired authentication token
1281
+
1282
+ HTTPError: When Purview API returns error:
1283
+ - 400: Bad request (invalid parameters)
1284
+ - 401: Unauthorized (authentication failed)
1285
+ - 403: Forbidden (insufficient permissions)
1286
+ - 404: Resource not found
1287
+ - 429: Rate limit exceeded
1288
+ - 500: Internal server error
1289
+
1290
+ NetworkError: When network connectivity fails
1291
+
1292
+ Example:
1293
+ # Basic usage
1294
+ client = Search()
1295
+
1296
+ result = client.querySuggest(args=...)
1297
+ print(f"Result: {result}")
1298
+
1299
+ Use Cases:
1300
+ - Data Discovery: Locate datasets by name or properties
1301
+ - Impact Analysis: Find all assets related to a term
1302
+ - Compliance: Identify sensitive data across catalog
1303
+ """
1304
+ return self.searchSuggest(args)
1305
+
1306
+ @decorator
1307
+ def queryAutoComplete(self, args):
1308
+ """
1309
+ Search for search results.
1310
+
1311
+ Searches for resources matching the specified criteria.
1312
+ Supports filtering, pagination, and sorting.
1313
+
1314
+ Args:
1315
+ args: Dictionary of operation arguments.
1316
+ Contains operation-specific parameters.
1317
+ See method implementation for details.
1318
+
1319
+ Returns:
1320
+ Dictionary containing search results:
1321
+ {
1322
+ 'value': [...] # List of matching resources
1323
+ 'count': int, # Total results count
1324
+ 'nextLink': str # Pagination link (if applicable)
1325
+ }
1326
+
1327
+ Raises:
1328
+ ValueError: When required parameters are missing or invalid:
1329
+ - Empty or None values for required fields
1330
+ - Invalid GUID format
1331
+ - Out-of-range values
1332
+
1333
+ AuthenticationError: When Azure credentials are invalid:
1334
+ - DefaultAzureCredential not configured
1335
+ - Insufficient permissions
1336
+ - Expired authentication token
1337
+
1338
+ HTTPError: When Purview API returns error:
1339
+ - 400: Bad request (invalid parameters)
1340
+ - 401: Unauthorized (authentication failed)
1341
+ - 403: Forbidden (insufficient permissions)
1342
+ - 404: Resource not found
1343
+ - 429: Rate limit exceeded
1344
+ - 500: Internal server error
1345
+
1346
+ NetworkError: When network connectivity fails
1347
+
1348
+ Example:
1349
+ # Basic usage
1350
+ client = Search()
1351
+
1352
+ result = client.queryAutoComplete(args=...)
1353
+ print(f"Result: {result}")
1354
+
1355
+ Use Cases:
1356
+ - Data Discovery: Locate datasets by name or properties
1357
+ - Impact Analysis: Find all assets related to a term
1358
+ - Compliance: Identify sensitive data across catalog
1359
+ """
1360
+ return self.searchAutocomplete(args)
1361
+
1362
+ @decorator
1363
+ def browseEntity(self, args):
1364
+ """
1365
+ Search for search results.
1366
+
1367
+ Searches for resources matching the specified criteria.
1368
+ Supports filtering, pagination, and sorting.
1369
+
1370
+ Args:
1371
+ args: Dictionary of operation arguments.
1372
+ Contains operation-specific parameters.
1373
+ See method implementation for details.
1374
+
1375
+ Returns:
1376
+ Dictionary containing search results:
1377
+ {
1378
+ 'value': [...] # List of matching resources
1379
+ 'count': int, # Total results count
1380
+ 'nextLink': str # Pagination link (if applicable)
1381
+ }
1382
+
1383
+ Raises:
1384
+ ValueError: When required parameters are missing or invalid:
1385
+ - Empty or None values for required fields
1386
+ - Invalid GUID format
1387
+ - Out-of-range values
1388
+
1389
+ AuthenticationError: When Azure credentials are invalid:
1390
+ - DefaultAzureCredential not configured
1391
+ - Insufficient permissions
1392
+ - Expired authentication token
1393
+
1394
+ HTTPError: When Purview API returns error:
1395
+ - 400: Bad request (invalid parameters)
1396
+ - 401: Unauthorized (authentication failed)
1397
+ - 403: Forbidden (insufficient permissions)
1398
+ - 404: Resource not found
1399
+ - 429: Rate limit exceeded
1400
+ - 500: Internal server error
1401
+
1402
+ NetworkError: When network connectivity fails
1403
+
1404
+ Example:
1405
+ # Basic usage
1406
+ client = EntitySearch()
1407
+
1408
+ result = client.browseEntity(args=...)
1409
+ print(f"Result: {result}")
1410
+
1411
+ Use Cases:
1412
+ - Data Discovery: Locate datasets by name or properties
1413
+ - Impact Analysis: Find all assets related to a term
1414
+ - Compliance: Identify sensitive data across catalog
1415
+ """
1416
+ return self.searchBrowse(args)
1417
+
1418
+ @decorator
1419
+ def searchWithFacets(self, args):
1420
+ """
1421
+ Search for search results.
1422
+
1423
+ Searches for resources matching the specified criteria.
1424
+ Supports filtering, pagination, and sorting.
1425
+
1426
+ Args:
1427
+ args: Dictionary of operation arguments.
1428
+ Contains operation-specific parameters.
1429
+ See method implementation for details.
1430
+
1431
+ Returns:
1432
+ Dictionary containing search results:
1433
+ {
1434
+ 'value': [...] # List of matching resources
1435
+ 'count': int, # Total results count
1436
+ 'nextLink': str # Pagination link (if applicable)
1437
+ }
1438
+
1439
+ Raises:
1440
+ ValueError: When required parameters are missing or invalid:
1441
+ - Empty or None values for required fields
1442
+ - Invalid GUID format
1443
+ - Out-of-range values
1444
+
1445
+ AuthenticationError: When Azure credentials are invalid:
1446
+ - DefaultAzureCredential not configured
1447
+ - Insufficient permissions
1448
+ - Expired authentication token
1449
+
1450
+ HTTPError: When Purview API returns error:
1451
+ - 400: Bad request (invalid parameters)
1452
+ - 401: Unauthorized (authentication failed)
1453
+ - 403: Forbidden (insufficient permissions)
1454
+ - 404: Resource not found
1455
+ - 429: Rate limit exceeded
1456
+ - 500: Internal server error
1457
+
1458
+ NetworkError: When network connectivity fails
1459
+
1460
+ Example:
1461
+ # Basic usage
1462
+ client = Search()
1463
+
1464
+ result = client.searchWithFacets(args=...)
1465
+ print(f"Result: {result}")
1466
+
1467
+ Use Cases:
1468
+ - Data Discovery: Locate datasets by name or properties
1469
+ - Impact Analysis: Find all assets related to a term
1470
+ - Compliance: Identify sensitive data across catalog
1471
+ """
1472
+ return self.searchFaceted(args)