entity_management.state

State of the interaction with nexus. For example current project to use.

Nexus organization, project and access token are initialized from the corresponding environment variables. They can be updated using setter functions from this module.

Functions

get_base()

Get global BASE url variable.

get_base_files([base])

Get url to nexus environment base for the files.

get_base_resolvers([base])

Get url to nexus environment base for the resolvers.

get_base_resources([base])

Get url to nexus environment base for the resources.

get_base_url([base, org, proj, ...])

Get base url.

get_base_views([base])

Get url to nexus environment base for the views.

get_es_url([base, org, proj])

Get base elasticsearch url.

get_offline_token()

Get offline token.

get_org([org])

Get current organization.

get_proj([proj])

Get current project.

get_sparql_url([base, org, proj])

Get base sparql url.

get_token()

Get access token.

get_token_info(token)

Decode token.

get_user_id([base, org, token])

Construct user id.

has_offline_token()

Checks if offline token is available.

refresh_token()

Get new access token from the offline token.

set_base(base)

Set global Base url variable.

set_org(org)

Set global Organization variable.

set_proj(proj)

Set global Project variable.

set_token(token)

Sets the token for interaction with Nexus API.

entity_management.state.get_base()

Get global BASE url variable.

entity_management.state.get_base_files(base=None)

Get url to nexus environment base for the files.

Parameters:

base (str) – optional Base url of nexus instance to be used.

Returns:

Nexus files endpoint url either based on base argument provided or based on the global Base variable value which is initialized from NEXUS_BASE environment variable.

entity_management.state.get_base_resolvers(base=None)

Get url to nexus environment base for the resolvers.

Parameters:

base (str) – optional Base url of nexus instance to be used.

Returns:

Nexus resolvers endpoint url either based on base argument provided or based on the global Base variable value which is initialized from NEXUS_BASE environment variable.

entity_management.state.get_base_resources(base=None)

Get url to nexus environment base for the resources.

Parameters:

base (str) – optional Base url of nexus instance to be used.

Returns:

Nexus resources endpoint url is either based on base function argument provided or based on the global BASE variable value which is initialized from NEXUS_BASE environment variable.

entity_management.state.get_base_url(base=None, org=None, proj=None, cross_bucket=False, schema_id=None)

Get base url.

entity_management.state.get_base_views(base=None)

Get url to nexus environment base for the views.

Parameters:

base (str) – optional Base url of nexus instance to be used.

Returns:

Nexus views endpoint url is either based on base function argument provided or based on the global BASE variable value which is initialized from NEXUS_BASE environment variable.

entity_management.state.get_es_url(base=None, org=None, proj=None)

Get base elasticsearch url.

entity_management.state.get_offline_token()

Get offline token.

entity_management.state.get_org(org=None)

Get current organization.

Parameters:

org (str) – optional Organization.

Returns:

org argument. If it was not provided then returns the value of global Organization variable which is initialized from NEXUS_ORG environment variable.

entity_management.state.get_proj(proj=None)

Get current project.

Parameters:

proj (str) – optional Project.

Returns:

proj argument. If it was not provided then returns the value of global Project variable which is initialized from NEXUS_PROJ environment variable.

entity_management.state.get_sparql_url(base=None, org=None, proj=None)

Get base sparql url.

entity_management.state.get_token()

Get access token.

entity_management.state.get_token_info(token)

Decode token.

entity_management.state.get_user_id(base=None, org=None, token=None)

Construct user id.

entity_management.state.has_offline_token()

Checks if offline token is available.

entity_management.state.refresh_token()

Get new access token from the offline token.

entity_management.state.set_base(base)

Set global Base url variable.

entity_management.state.set_org(org)

Set global Organization variable.

entity_management.state.set_proj(proj)

Set global Project variable.

entity_management.state.set_token(token)

Sets the token for interaction with Nexus API.