Implementation¶
- class starmap_client.StarmapClient(url=None, api_version='v2', session=None, session_params=None, provider=None)[source]¶
Implement the StArMap client.
- POLICIES_PER_PAGE = 100¶
Number of policies to retrieve per call.
- __init__(url=None, api_version='v2', session=None, session_params=None, provider=None)[source]¶
Create a new StArMapClient.
- Parameters:
url (str, optional) – URL of the StArMap endpoint. Required when session is not set.
api_version (str, optional) – The StArMap API version. Defaults to v2.
session (StarmapBaseSession, optional) – Defines the session object to use. Defaults to StarmapSession when not set
session_params (dict, optional) – Additional keyword arguments for StarmapSession
provider (StarmapProvider, optional) – Object responsible to provide mappings locally. When set the client will be query it first and if no mapping is found the subsequent request will be made to the server.
- query_image(nvr, **kwargs)[source]¶
Query StArMap using an image NVR.
- Parameters:
- Returns:
The query result when found or None.
- Return type:
- query_image_by_name(name, version=None, **kwargs)[source]¶
Query StArMap using an image NVR.
- Parameters:
- Returns:
The query result when found or None.
- Return type:
- list_destinations(mapping_id)[source]¶
List all destinations for a given Marketplace Mapping ID.
- Parameters:
mapping_id (str) – Marketplace Mapping ID to list the mappings.
- Return type:
- Returns:
List with the Destinations for the requested Mapping.