Skip to content

Commit 8cb5fc9

Browse files
authored
Merge pull request #595 from atlanhq/APP-5915
APP-5915 : Add "Workflow Name" as an optional param in `credentials.get_all()`
2 parents e34378a + 59a2f7d commit 8cb5fc9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pyatlan/client/credential.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,15 @@ def get_all(
8383
filter: Optional[Dict[str, Any]] = None,
8484
limit: Optional[int] = None,
8585
offset: Optional[int] = None,
86+
workflow_name: Optional[str] = None,
8687
) -> CredentialListResponse:
8788
"""
8889
Retrieves all credentials.
8990
9091
:param filter: (optional) dictionary specifying the filter criteria.
9192
:param limit: (optional) maximum number of credentials to retrieve.
9293
:param offset: (optional) number of credentials to skip before starting retrieval.
94+
:param workflow_name: (optional) name of the workflow to retrieve credentials for.
9395
:returns: CredentialListResponse instance.
9496
:raises: AtlanError on any error during API invocation.
9597
"""
@@ -101,6 +103,17 @@ def get_all(
101103
if offset is not None:
102104
params["offset"] = offset
103105

106+
if workflow_name is not None:
107+
if filter is None:
108+
filter = {}
109+
110+
if workflow_name.startswith("atlan-"):
111+
workflow_name = "default-" + workflow_name[len("atlan-") :]
112+
113+
filter["name"] = f"{workflow_name}-0"
114+
115+
params["filter"] = dumps(filter)
116+
104117
raw_json = self._client._call_api(
105118
GET_ALL_CREDENTIALS.format_path_with_params(), query_params=params
106119
)

0 commit comments

Comments
 (0)