Resource Manager that acquires and releases resources as well as keeping the record of acquired/released resources. More...
Public Member Functions | |
def | __init__ |
def | has_sources |
Returns true if there are any sources configured, false otherwise. More... | |
def | acquire_resource |
Acquire a matching resource using a type and a list of tags. More... | |
def | release_resource |
Releases specified resource and then remove it from the database. More... | |
def | get_acquired_resources |
Get already acquired resources. More... | |
def | get_acquired_resource_names |
Get already acquired resources names. More... | |
def | release_all_resources |
Release all acquired resources. More... | |
Resource Manager that acquires and releases resources as well as keeping the record of acquired/released resources.
Resource Manager has two resource provider sources, the remote service and the local host "offline" resource configuration.
Resource Manager prioritizes the local resources if it matches.
def etr.plugins.resources.ResourceManager.__init__ | ( | self, | |
resfile, | |||
host, | |||
storage | |||
) |
resfile | Resource file for local resources |
host | Address to the remote resource manager |
storage | The storage manager to use |
def etr.plugins.resources.ResourceManager.acquire_resource | ( | self, | |
name, | |||
type, | |||
tags = None |
|||
) |
Acquire a matching resource using a type and a list of tags.
First acquisition from local resources is attempted. If that fails the remote service is attempted.
name | Clients name for the resource. |
type | Resource type |
tags | Tags that must match. Optional and is empty by default. |
def etr.plugins.resources.ResourceManager.get_acquired_resource_names | ( | self | ) |
Get already acquired resources names.
def etr.plugins.resources.ResourceManager.get_acquired_resources | ( | self | ) |
Get already acquired resources.
def etr.plugins.resources.ResourceManager.has_sources | ( | self | ) |
Returns true if there are any sources configured, false otherwise.
def etr.plugins.resources.ResourceManager.release_all_resources | ( | self | ) |
Release all acquired resources.
def etr.plugins.resources.ResourceManager.release_resource | ( | self, | |
source, | |||
resource_id | |||
) |
Releases specified resource and then remove it from the database.
source | Source url for the resource |
resource_id | Unique resource id |