conductor.lib.api_client module

class conductor.lib.api_client.ApiClient
http_verbs = ['PUT', 'POST', 'GET', 'DELETE', 'HEAD', 'PATCH']
make_request(uri_path='/', headers=None, params=None, data=None, verb=None, conductor_url=None, raise_on_error=True, tries=5, use_api_key=False)

verb: PUT, POST, GET, DELETE, HEAD, PATCH

conductor.lib.api_client.account_id_from_jwt(token)

Fetch the accounts id from a jwt token value.

conductor.lib.api_client.account_name_from_jwt(token)

Fetch the accounts name from a jwt token value.

conductor.lib.api_client.get_api_key_bearer_token(creds_file=None)
conductor.lib.api_client.get_creds_path(api_key=False)
conductor.lib.api_client.read_conductor_credentials(use_api_key=False)

Read the conductor credentials file, if it exists.

This will contain a bearer token from either the user or the API key (if that’s desired). If the credentials file doesn’t exist, try and fetch a new one in the API key scenario or prompt the user to log in.

Parameters:use_api_key (bool) – Whether or not to use the API key.
Returns:A Bearer token in the event of a success or None if things couldn’t get figured out
Return type:object
conductor.lib.api_client.request_projects(statuses=('active', ))

Query Conductor for all client Projects that are in the given state(s)

conductor.lib.api_client.request_sidecar(sidecar_id=None)

Return the sidecar entity for the given sidecar_id.

If no sidecar_id is given, return the latest sidecar

conductor.lib.api_client.request_software_packages(sidecar_id=None)

Query Conductor for all software packages for the given sidecar_id.

If no sidecar_id is given then get the latest packages (uses latest sidecar_id)