pvw-cli 1.2.4__py3-none-any.whl → 1.2.5__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.

@@ -168,7 +168,9 @@ class Entity(Endpoint):
168
168
  def entityReadUniqueAttribute(self, args):
169
169
  """Get entity by unique attributes (Official API: Get By Unique Attributes)"""
170
170
  self.method = "GET"
171
- self.endpoint = ENDPOINTS["entity"]["get_by_unique_attributes"].format(typeName=args["--typeName"])
171
+ self.endpoint = ENDPOINTS["entity"]["get_by_unique_attributes"].format(
172
+ typeName=args["--typeName"]
173
+ )
172
174
  self.params = {
173
175
  **get_api_version_params("datamap"),
174
176
  "attr:qualifiedName": args["--qualifiedName"],
@@ -180,7 +182,9 @@ class Entity(Endpoint):
180
182
  def entityReadBulkUniqueAttribute(self, args):
181
183
  """List entities by unique attributes (Official API: List By Unique Attributes)"""
182
184
  self.method = "GET"
183
- self.endpoint = ENDPOINTS["entity"]["list_by_unique_attributes"].format(typeName=args["--typeName"])
185
+ self.endpoint = ENDPOINTS["entity"]["list_by_unique_attributes"].format(
186
+ typeName=args["--typeName"]
187
+ )
184
188
  params = {
185
189
  **get_api_version_params("datamap"),
186
190
  "ignoreRelationships": str(args.get("--ignoreRelationships", False)).lower(),
@@ -197,7 +201,9 @@ class Entity(Endpoint):
197
201
  def entityUpdateUniqueAttribute(self, args):
198
202
  """Update entity by unique attributes (Official API: Update By Unique Attributes)"""
199
203
  self.method = "PUT"
200
- self.endpoint = ENDPOINTS["entity"]["update_by_unique_attributes"].format(typeName=args["--typeName"])
204
+ self.endpoint = ENDPOINTS["entity"]["update_by_unique_attributes"].format(
205
+ typeName=args["--typeName"]
206
+ )
201
207
  self.params = {
202
208
  **get_api_version_params("datamap"),
203
209
  "attr:qualifiedName": args["--qualifiedName"],
@@ -208,7 +214,9 @@ class Entity(Endpoint):
208
214
  def entityDeleteUniqueAttribute(self, args):
209
215
  """Delete entity by unique attributes (Official API: Delete By Unique Attribute)"""
210
216
  self.method = "DELETE"
211
- self.endpoint = ENDPOINTS["entity"]["delete_by_unique_attribute"].format(typeName=args["--typeName"])
217
+ self.endpoint = ENDPOINTS["entity"]["delete_by_unique_attribute"].format(
218
+ typeName=args["--typeName"]
219
+ )
212
220
  self.params = {
213
221
  **get_api_version_params("datamap"),
214
222
  "attr:qualifiedName": args["--qualifiedName"],
@@ -290,7 +298,9 @@ class Entity(Endpoint):
290
298
  def entityUpdateClassificationsByUniqueAttribute(self, args):
291
299
  """Update classifications to an entity by unique attribute (Official API: Update Classifications By Unique Attribute)"""
292
300
  self.method = "PUT"
293
- self.endpoint = ENDPOINTS["entity"]["update_classifications_by_unique_attribute"].format(typeName=args["--typeName"])
301
+ self.endpoint = ENDPOINTS["entity"]["update_classifications_by_unique_attribute"].format(
302
+ typeName=args["--typeName"]
303
+ )
294
304
  self.params = {
295
305
  **get_api_version_params("datamap"),
296
306
  "attr:qualifiedName": args["--qualifiedName"],
@@ -301,7 +311,9 @@ class Entity(Endpoint):
301
311
  def entityCreateClassificationsByUniqueAttribute(self, args):
302
312
  """Add classifications to an entity by unique attribute (Official API: Add Classifications By Unique Attribute)"""
303
313
  self.method = "POST"
304
- self.endpoint = ENDPOINTS["entity"]["add_classifications_by_unique_attribute"].format(typeName=args["--typeName"])
314
+ self.endpoint = ENDPOINTS["entity"]["add_classifications_by_unique_attribute"].format(
315
+ typeName=args["--typeName"]
316
+ )
305
317
  self.params = {
306
318
  **get_api_version_params("datamap"),
307
319
  "attr:qualifiedName": args["--qualifiedName"],
@@ -322,8 +334,25 @@ class Entity(Endpoint):
322
334
  def entityDeleteBusinessMetadata(self, args):
323
335
  """Remove business metadata from an entity (Official API: Remove Business Metadata)"""
324
336
  self.method = "DELETE"
325
- self.endpoint = ENDPOINTS["entity"]["remove_business_metadata"].format(guid=args["--guid"][0])
326
- self.params = {**get_api_version_params("datamap"), "businessMetadataName": args["--businessMetadataName"]}
337
+
338
+ # Support both --businessMetadataName (direct) and --payloadFile (from CLI)
339
+ if "--payloadFile" in args:
340
+ payload = get_json(args, "--payloadFile")
341
+ # Get the first business metadata name from the payload
342
+ business_metadata_names = list(payload.keys())
343
+ if not business_metadata_names:
344
+ raise ValueError("No business metadata names found in payload file")
345
+ business_metadata_name = business_metadata_names[0]
346
+ else:
347
+ business_metadata_name = args["--businessMetadataName"]
348
+
349
+ self.endpoint = ENDPOINTS["entity"]["remove_business_metadata"].format(
350
+ guid=args["--guid"][0]
351
+ )
352
+ self.params = {
353
+ **get_api_version_params("datamap"),
354
+ "businessMetadataName": business_metadata_name,
355
+ }
327
356
 
328
357
  @decorator
329
358
  def entityCreateBusinessMetadataAttributes(self, args):
@@ -342,7 +371,10 @@ class Entity(Endpoint):
342
371
  self.endpoint = ENDPOINTS["entity"]["remove_business_metadata_attributes"].format(
343
372
  guid=args["--guid"][0], businessMetadataName=args["--businessMetadataName"]
344
373
  )
345
- self.params = {**get_api_version_params("datamap"), "businessMetadataAttributes": args["--attributes"]}
374
+ self.params = {
375
+ **get_api_version_params("datamap"),
376
+ "businessMetadataAttributes": args["--attributes"],
377
+ }
346
378
 
347
379
  @decorator
348
380
  def entityImportBusinessMetadata(self, args):
@@ -359,6 +391,23 @@ class Entity(Endpoint):
359
391
  self.endpoint = ENDPOINTS["entity"]["business_metadata_template"]
360
392
  self.params = get_api_version_params("datamap")
361
393
 
394
+ # Aliases for CLI compatibility
395
+ def entityAddOrUpdateBusinessMetadata(self, args):
396
+ """Alias for entityCreateBusinessMetadata"""
397
+ return self.entityCreateBusinessMetadata(args)
398
+
399
+ def entityAddOrUpdateBusinessMetadataAttributes(self, args):
400
+ """Alias for entityCreateBusinessMetadataAttributes"""
401
+ return self.entityCreateBusinessMetadataAttributes(args)
402
+
403
+ def entityRemoveBusinessMetadata(self, args):
404
+ """Alias for entityDeleteBusinessMetadata"""
405
+ return self.entityDeleteBusinessMetadata(args)
406
+
407
+ def entityRemoveBusinessMetadataAttributes(self, args):
408
+ """Alias for entityDeleteBusinessMetadataAttributes"""
409
+ return self.entityDeleteBusinessMetadataAttributes(args)
410
+
362
411
  # === LABEL OPERATIONS ===
363
412
 
364
413
  @decorator
@@ -391,7 +440,9 @@ class Entity(Endpoint):
391
440
  def entityCreateLabelsByUniqueAttribute(self, args):
392
441
  """Add labels to an entity by unique attribute (Official API: Add Labels By Unique Attribute)"""
393
442
  self.method = "POST"
394
- self.endpoint = ENDPOINTS["entity"]["add_labels_by_unique_attribute"].format(typeName=args["--typeName"])
443
+ self.endpoint = ENDPOINTS["entity"]["add_labels_by_unique_attribute"].format(
444
+ typeName=args["--typeName"]
445
+ )
395
446
  self.params = {
396
447
  **get_api_version_params("datamap"),
397
448
  "attr:qualifiedName": args["--qualifiedName"],
@@ -402,7 +453,9 @@ class Entity(Endpoint):
402
453
  def entityUpdateLabelsByUniqueAttribute(self, args):
403
454
  """Set labels to an entity by unique attribute (Official API: Set Labels By Unique Attribute)"""
404
455
  self.method = "PUT"
405
- self.endpoint = ENDPOINTS["entity"]["set_labels_by_unique_attribute"].format(typeName=args["--typeName"])
456
+ self.endpoint = ENDPOINTS["entity"]["set_labels_by_unique_attribute"].format(
457
+ typeName=args["--typeName"]
458
+ )
406
459
  self.params = {
407
460
  **get_api_version_params("datamap"),
408
461
  "attr:qualifiedName": args["--qualifiedName"],
@@ -413,7 +466,9 @@ class Entity(Endpoint):
413
466
  def entityDeleteLabelsByUniqueAttribute(self, args):
414
467
  """Remove labels from an entity by unique attribute (Official API: Remove Labels By Unique Attribute)"""
415
468
  self.method = "DELETE"
416
- self.endpoint = ENDPOINTS["entity"]["remove_labels_by_unique_attribute"].format(typeName=args["--typeName"])
469
+ self.endpoint = ENDPOINTS["entity"]["remove_labels_by_unique_attribute"].format(
470
+ typeName=args["--typeName"]
471
+ )
417
472
  self.params = {
418
473
  **get_api_version_params("datamap"),
419
474
  "attr:qualifiedName": args["--qualifiedName"],
@@ -440,7 +495,7 @@ class Entity(Endpoint):
440
495
  self.params = {
441
496
  **get_api_version_params("datamap"),
442
497
  "limit": args.get("--limit", 100),
443
- "offset": args.get("--offset", 0)
498
+ "offset": args.get("--offset", 0),
444
499
  }
445
500
 
446
501
  @decorator
@@ -452,7 +507,7 @@ class Entity(Endpoint):
452
507
  **get_api_version_params("datamap"),
453
508
  "startTime": args.get("--startTime"),
454
509
  "endTime": args.get("--endTime"),
455
- "auditAction": args.get("--auditAction")
510
+ "auditAction": args.get("--auditAction"),
456
511
  }
457
512
 
458
513
  @decorator
@@ -467,11 +522,13 @@ class Entity(Endpoint):
467
522
  def entityReadDependencies(self, args):
468
523
  """Get entity dependencies for given GUID (Advanced API: Get Entity Dependencies)"""
469
524
  self.method = "GET"
470
- self.endpoint = ENDPOINTS["entity"]["get_entity_dependencies"].format(guid=args["--guid"][0])
525
+ self.endpoint = ENDPOINTS["entity"]["get_entity_dependencies"].format(
526
+ guid=args["--guid"][0]
527
+ )
471
528
  self.params = {
472
529
  **get_api_version_params("datamap"),
473
530
  "direction": args.get("--direction", "both"),
474
- "depth": args.get("--depth", 1)
531
+ "depth": args.get("--depth", 1),
475
532
  }
476
533
 
477
534
  @decorator
@@ -483,7 +540,7 @@ class Entity(Endpoint):
483
540
  **get_api_version_params("datamap"),
484
541
  "startTime": args.get("--startTime"),
485
542
  "endTime": args.get("--endTime"),
486
- "aggregation": args.get("--aggregation", "daily")
543
+ "aggregation": args.get("--aggregation", "daily"),
487
544
  }
488
545
 
489
546
  # === LEGACY COMPATIBILITY METHODS ===
@@ -120,6 +120,37 @@ class Types(Endpoint):
120
120
  self.endpoint = ENDPOINTS["types"]["get_business_metadata_def_by_name"].format(name=args["--name"])
121
121
  self.params = get_api_version_params("datamap")
122
122
 
123
+ @decorator
124
+ def createBusinessMetadataDef(self, args):
125
+ """Create business metadata definition (Official API: Create Business Metadata Definition)"""
126
+ self.method = "POST"
127
+ self.endpoint = ENDPOINTS["types"]["bulk_create"]
128
+ self.params = get_api_version_params("datamap")
129
+ self.payload = get_json(args, "--payloadFile")
130
+
131
+ @decorator
132
+ def updateBusinessMetadataDef(self, args):
133
+ """Update business metadata definition (Official API: Update Business Metadata Definition)"""
134
+ self.method = "PUT"
135
+ self.endpoint = ENDPOINTS["types"]["bulk_update"]
136
+ self.params = get_api_version_params("datamap")
137
+ self.payload = get_json(args, "--payloadFile")
138
+
139
+ @decorator
140
+ def deleteBusinessMetadataDef(self, args):
141
+ """Delete business metadata definition by name (Official API: Delete Business Metadata Definition)"""
142
+ self.method = "DELETE"
143
+ self.endpoint = ENDPOINTS["types"]["bulk_delete"]
144
+ self.params = get_api_version_params("datamap")
145
+ # Construct payload with businessMetadataDefs array containing the name to delete
146
+ self.payload = {
147
+ "businessMetadataDefs": [
148
+ {
149
+ "name": args["--name"]
150
+ }
151
+ ]
152
+ }
153
+
123
154
  # === CLASSIFICATION DEFINITIONS ===
124
155
 
125
156
  @decorator