Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance lease get with details call to include extra capabilities #114

Open
wants to merge 1 commit into
base: chameleoncloud/xena
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions blazar/manager/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,31 @@ def get_lease(self, lease_id):
return db_api.lease_get(lease_id)

def hosts_in_lease(self, lease_id):
return db_api.hosts_in_lease(lease_id)
hosts = db_api.hosts_in_lease(lease_id)
from blazar.plugins.oshosts import RESOURCE_TYPE as resource_type
for host in hosts:
extra_capabilities = self.plugins[resource_type]._get_extra_capabilities(host['id'])
if host is not None and extra_capabilities:
host.update(extra_capabilities)
return hosts

def networks_in_lease(self, lease_id):
return db_api.networks_in_lease(lease_id)
networks = db_api.networks_in_lease(lease_id)
from blazar.plugins.networks import RESOURCE_TYPE as resource_type
for network in networks:
extra_capabilities = self.plugins[resource_type]._get_extra_capabilities(network['id'])
if network is not None and extra_capabilities:
network.update(extra_capabilities)
return networks

def devices_in_lease(self, lease_id):
return db_api.devices_in_lease(lease_id)
devices = db_api.devices_in_lease(lease_id)
from blazar.plugins.devices import RESOURCE_TYPE as resource_type
for device in devices:
extra_capabilities = self.plugins[resource_type]._get_extra_capabilities(device['id'])
if device is not None and extra_capabilities:
device.update(extra_capabilities)
return devices

def list_leases(self, project_id=None, query=None):
return db_api.lease_list(project_id)
Expand Down
Loading