atoti.Client.get_path_and_version_id()#

Client.get_path_and_version_id(api_name: str, /, *, denied_version_ids: Set[str] = frozenset({}), path_type: Literal['rest', 'ws'] = 'rest') tuple[str, str]#
Client.get_path_and_version_id(api_name: str, /, *, allowed_version_ids: Sequence[VersionIdT_co], denied_version_ids: Set[str] = frozenset({}), path_type: Literal['rest', 'ws'] = 'rest') tuple[str, VersionIdT_co]

Return the matching (path, version_id).

If allowed_version_ids is not None, the server versions will be iterated following the order of its elements.

Example

>>> session.client.get_path_and_version_id("activeviam/pivot")
('activeviam/pivot/rest/v10', '10')
>>> session.client.get_path_and_version_id(
...     "activeviam/pivot", path_type="ws"
... )
('activeviam/pivot/ws/v9', '9')
>>> session.client.get_path_and_version_id(
...     "activeviam/pivot", allowed_version_ids=["8", "7"]
... )
Traceback (most recent call last):
  ...
RuntimeError: None of the allowed version IDs ['8', '7'] match the provided ones: ['9', '10'].
>>> session.client.get_path_and_version_id(
...     "activeviam/pivot", denied_version_ids={"9", "10", "11"}
... )
Traceback (most recent call last):
  ...
RuntimeError: No `activeviam/pivot` API with `rest` path found.

See also

http_client for an example of how this method can be used.