Skip to content

Commit

Permalink
bfabric_delete.py allow passing multiple IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Aug 26, 2024
1 parent db26ea8 commit 10fac42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bfabric/scripts/bfabric_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from bfabric import Bfabric


def bfabric_delete(client: Bfabric, endpoint: str, id: int) -> None:
def bfabric_delete(client: Bfabric, endpoint: str, id: list[int]) -> None:
"""Deletes the object with id `id` from the `endpoint`."""
res = client.delete(endpoint=endpoint, id=id).to_list_dict()
print(json.dumps(res, indent=2))
Expand All @@ -26,8 +26,8 @@ def main() -> None:
"""Parses arguments and calls `bfabric_delete`."""
client = Bfabric.from_config()
parser = argparse.ArgumentParser()
parser.add_argument("endpoint", help="endpoint", choices=bfabric.endpoints)
parser.add_argument("id", help="id", type=int)
parser.add_argument("endpoint", help="endpoint", type=str)
parser.add_argument("id", help="id", type=int, nargs="+")
args = parser.parse_args()
bfabric_delete(client=client, endpoint=args.endpoint, id=args.id)

Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Versioning currently follows `X.Y.Z` where
### Changed

- `bfabric_read.py` prints non-output information exclusively through logger.
- `bfabric_delete.py` accepts multiple ids at once and does not restrict entity types anymore.

## \[1.13.5\] - 2024-08-13

Expand Down

0 comments on commit 10fac42

Please sign in to comment.