Skip to content

Commit

Permalink
Merge pull request #1055 from pjhinton-globus/pjhinton/sc-29242-endpo…
Browse files Browse the repository at this point in the history
…int-search-filter-entity-type

add support for entity type filtering on endpoint search
  • Loading branch information
sirosen authored Jan 9, 2025
2 parents 39d7110 + 63d104a commit bce3d54
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Enhancements

* Added a `--filter-entity-type` option on endpoint search.
26 changes: 26 additions & 0 deletions src/globus_cli/commands/endpoint/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@
type=click.IntRange(1, 1000),
help="The maximum number of results to return.",
)
@click.option(
"--filter-entity-type",
default=None,
type=click.Choice(
(
"GCP_mapped_collection",
"GCP_guest_collection",
"GCSv5_endpoint",
"GCSv5_mapped_collection",
"GCSv5_guest_collection",
),
case_sensitive=False,
),
help="Filter search results to endpoints of a specific entity type.",
)
@click.argument("filter_fulltext", required=False)
@LoginManager.requires_login("auth", "transfer")
def endpoint_search(
Expand All @@ -86,6 +101,16 @@ def endpoint_search(
"shared-by-me",
"shared-with-me",
],
filter_entity_type: (
t.Literal[
"GCP_mapped_collection",
"GCP_guest_collection",
"GCSv5_endpoint",
"GCSv5_mapped_collection",
"GCSv5_guest_collection",
]
| None
),
) -> None:
"""
Search for Globus endpoints with search filters. If --filter-scope is set to the
Expand Down Expand Up @@ -121,6 +146,7 @@ def endpoint_search(
filter_fulltext=filter_fulltext,
filter_scope=filter_scope,
filter_owner_id=owner_id,
filter_entity_type=filter_entity_type,
).items(),
limit=limit,
)
Expand Down

0 comments on commit bce3d54

Please sign in to comment.