Data Management RESTful API

Methods

class dmp.rest.rest(cnf_loc='', test=False)[source]

API for management of files within the VRE

add_service(name, url, description, status=None)[source]

Add a service to the registry

Parameters:
  • name (str) – Unique name for the service
  • description (str) – Description defined by the service
  • url (str) – Base URL for the REST service.
  • status (str) – Service HTTP status code - up or down
Returns:

Entry ID

Return type:

str

get_available_services()[source]

List all services

Returns:List of dict objects for each service
Return type:list
get_down_services()[source]

List services that are NOT returning HTTP code 200

Returns:List of dict objects for each service
Return type:list
get_service(name)[source]

Retreive the full details about a service

Parameters:name (str) – Unique name for the service
Returns:
name: str
Unique name for the service
description: str
Description defined by the service
url: str
Base URL for the RESET service.
status: str
Service HTTP status code - up or down
Return type:dict
get_up_services()[source]

List services that are returning HTTP code 200

Returns:List of dict objects for each service
Return type:list
is_service(name)[source]

Identify if a service is already present in the registry

Parameters:name (str) – Unique name for the service
set_service_status(name, status)[source]

Update the status of the service if it is already present in the db.

Parameters:
  • name (str) – Unique name for the service
  • status (str) – Service HTTP status code - up or down
Returns:

True when done

Return type:

bool

update_service_url(name, url)[source]

Update the url of the service if it is already present in the db.

Parameters:
  • name (str) – Unique name for the service
  • url (str) – Base URL for the REST service.
Returns:

True when done

Return type:

bool