seq  1.1.0
 All Classes Namespaces Files Functions Variables Groups Pages
Public Member Functions | List of all members
etr.plugins.resources.RemoteService Class Reference

Adapter for the remote resource manager service. More...

Public Member Functions

def __init__
 
def source
 Returns source component of the remote service. More...
 
def acquire_resource
 Request resource acquisition. More...
 
def release_resource
 Release already acquired resource. More...
 

Detailed Description

Adapter for the remote resource manager service.

Constructor & Destructor Documentation

def etr.plugins.resources.RemoteService.__init__ (   self,
  host 
)

Member Function Documentation

def etr.plugins.resources.RemoteService.acquire_resource (   self,
  type,
  tags 
)

Request resource acquisition.

   The service should return a json structure:
   On failure:
       {'status': 'failure',
        'message': 'failure message'}
On Success
{ 'status': 'success', 'resources': [{ 'id': 'resource-id', 'attributes': {...} ... }, ...] }

Returns tuple of (resource_id, attributes, '') on success or (None, None, 'msg') on failure.

def etr.plugins.resources.RemoteService.release_resource (   self,
  resource_id 
)

Release already acquired resource.

   The service should return a json structure:

   On service failure:

       {
           'status': 'failure',
            'message': 'failure message'
       }
On Success
{ 'status': 'success', 'resources': { '<id>': '<status>',
} }

Where '<status>' takes on the follow forms 'released', resource released 'n/a', resource was not locked or found 'error' error occurred for this resource (not released). Will raise an exception.

Raises error if resource was not released by remote service.

def etr.plugins.resources.RemoteService.source (   self)

Returns source component of the remote service.


The documentation for this class was generated from the following file: