cortexapps-cli 1.46.0__py3-none-any.whl → 1.47.0__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.
@@ -123,22 +123,29 @@ def delete(
123
123
  client.delete("api/v1/catalog/" + tag)
124
124
 
125
125
  @app.command()
126
- def delete_by_type(
126
+ def delete_by_id(
127
127
  ctx: typer.Context,
128
- types: CatalogCommandOptions.types = None,
128
+ ids: Optional[List[str]] = typer.Option(None, "--id", "-i", help="CID of an entity to delete (e.g. en2da8159dbeefb974). Can be specified multiple times.", show_default=False),
129
+ file_input: Annotated[Optional[typer.FileText], typer.Option("--file", "-f", help="File containing one CID per line; can be passed as stdin with -, example: -f-")] = None,
130
+ batch_size: int = typer.Option(100, "--batch-size", hidden=True, help="Number of IDs per API call when processing file input"),
129
131
  ):
130
132
  """
131
- Dangerous operation that will delete all entities that are of the given type
133
+ Delete entities by CID. Accepts one or more --id flags, or a file with one CID per line.
132
134
  """
133
- client = ctx.obj["client"]
135
+ if ids and file_input:
136
+ raise typer.BadParameter("Specify either --id or --file, not both")
134
137
 
135
- #TODO: check if types is a regex of form: ([-A-Za-z]+,)+
138
+ if not ids and not file_input:
139
+ raise typer.BadParameter("One of --id or --file is required")
136
140
 
137
- params = {
138
- "types": types
139
- }
141
+ client = ctx.obj["client"]
140
142
 
141
- client.delete("api/v1/catalog", params=params)
143
+ if file_input:
144
+ all_ids = [line.strip() for line in file_input if line.strip()]
145
+ for i in range(0, len(all_ids), batch_size):
146
+ client.delete("api/v1/catalog", params={"ids": all_ids[i:i + batch_size]})
147
+ else:
148
+ client.delete("api/v1/catalog", params={"ids": ids})
142
149
 
143
150
  @app.command()
144
151
  def descriptor(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cortexapps-cli
3
- Version: 1.46.0
3
+ Version: 1.47.0
4
4
  Summary: Command Line Interface for cortexapps
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -6,7 +6,7 @@ cortexapps_cli/commands/api_keys.py,sha256=f5LfrfuYJowH3BsHXR28hSmysSRoEcPU9PWAl
6
6
  cortexapps_cli/commands/audit_logs.py,sha256=u0fa5I4GFZrcn8kUa0zwZPMkrmrUsgzh6NGVr8i7MEU,4194
7
7
  cortexapps_cli/commands/backup.py,sha256=RLdFrkUiLzD763DgKDBgJwAufYzXziXXbPnBLe-Yijc,39152
8
8
  cortexapps_cli/commands/backup_commands/cortex_export.py,sha256=hn6SBGRyYspamhOT8p4F_WS0DLcuiDpMdUpi15FsGUY,4680
9
- cortexapps_cli/commands/catalog.py,sha256=TSl9jrELFQ_i_Cx66LP6xBByRnsO4PuUlihw4r9_5Hk,14969
9
+ cortexapps_cli/commands/catalog.py,sha256=CaXGO8SWNyU-amyqAqN_xE6PVPsQKhF5MowGUP67RKM,15774
10
10
  cortexapps_cli/commands/catalogs.py,sha256=kiOP2gO1rOA3YVHCzvJAhgaG6uB7HbT1MbaU0-mjwjs,3540
11
11
  cortexapps_cli/commands/custom_data.py,sha256=ip1Iw7P111Zb-M6fJfxJUQQ9Dc97PcxMnkPMN7RXw9Q,6834
12
12
  cortexapps_cli/commands/custom_events.py,sha256=AihNx8FsBMNiak3ortNKNRmfP5NogQ0pMqMEe4R8NLw,10157
@@ -274,8 +274,8 @@ cortexapps_cli/solutions/workday/data/configuration.json,sha256=8_C6pFrCSSXIv3hx
274
274
  cortexapps_cli/solutions/workday/data/pied-piper-supervisory-org.json,sha256=OS0F5Pl0sBS4pENRsEhHAkAcXfqg8GLI8dJx2sqEvtE,3191
275
275
  cortexapps_cli/solutions/workday/setup.py,sha256=t7I5sCXqta66lC9PKEZfpSZ8l_0OBbCnpvSFuh7y9Jw,5591
276
276
  cortexapps_cli/utils.py,sha256=zJilDiFhL-cYdp5LA251rED7vdc0EIEivCZpCqQRvmI,6992
277
- cortexapps_cli-1.46.0.dist-info/METADATA,sha256=XNiZqUI--H6VTeRWDm71pAXqLj66-E0hWu-ufa-2jFU,17883
278
- cortexapps_cli-1.46.0.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
279
- cortexapps_cli-1.46.0.dist-info/entry_points.txt,sha256=YffF7CawiDnK0vE7Fg9mAItnXoSjLvVkW3IdHhumz84,49
280
- cortexapps_cli-1.46.0.dist-info/licenses/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
281
- cortexapps_cli-1.46.0.dist-info/RECORD,,
277
+ cortexapps_cli-1.47.0.dist-info/METADATA,sha256=UwMiDN3f5zTqLPNG-7QIZOxZw3RiKfqXPyrGN_X8BwA,17883
278
+ cortexapps_cli-1.47.0.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
279
+ cortexapps_cli-1.47.0.dist-info/entry_points.txt,sha256=YffF7CawiDnK0vE7Fg9mAItnXoSjLvVkW3IdHhumz84,49
280
+ cortexapps_cli-1.47.0.dist-info/licenses/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
281
+ cortexapps_cli-1.47.0.dist-info/RECORD,,