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 global |
|
Get url to nexus environment base for the files. |
|
Get url to nexus environment base for the resolvers. |
|
Get url to nexus environment base for the resources. |
|
Get base url. |
|
Get url to nexus environment base for the views. |
|
Get base elasticsearch url. |
Get offline token. |
|
|
Get current organization. |
|
Get current project. |
|
Get base sparql url. |
Get access token. |
|
|
Decode token. |
|
Construct user id. |
Checks if offline token is available. |
|
Get new access token from the offline token. |
|
|
Set global |
|
Set global |
|
Set global |
|
Sets the token for interaction with Nexus API. |
- entity_management.state.get_base()¶
Get global
BASEurl variable.
- entity_management.state.get_base_files(base=None)¶
Get url to nexus environment base for the files.
- Parameters:
base (str) – optional
Baseurl of nexus instance to be used.- Returns:
Nexus files endpoint url either based on
baseargument provided or based on the globalBasevariable 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
Baseurl of nexus instance to be used.- Returns:
Nexus resolvers endpoint url either based on
baseargument provided or based on the globalBasevariable 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
Baseurl of nexus instance to be used.- Returns:
Nexus resources endpoint url is either based on
basefunction argument provided or based on the globalBASEvariable 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
Baseurl of nexus instance to be used.- Returns:
Nexus views endpoint url is either based on
basefunction argument provided or based on the globalBASEvariable 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:
orgargument. If it was not provided then returns the value of globalOrganizationvariable which is initialized from NEXUS_ORG environment variable.
- entity_management.state.get_proj(proj=None)¶
Get current project.
- Parameters:
proj (str) – optional Project.
- Returns:
projargument. If it was not provided then returns the value of globalProjectvariable 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
Baseurl variable.
- entity_management.state.set_org(org)¶
Set global
Organizationvariable.
- entity_management.state.set_proj(proj)¶
Set global
Projectvariable.
- entity_management.state.set_token(token)¶
Sets the token for interaction with Nexus API.