# create operation
content["_admin"]["operations"] = [self._create_operation("create")]
content["_admin"]["current_operation"] = None
# create operation
content["_admin"]["operations"] = [self._create_operation("create")]
content["_admin"]["current_operation"] = None
+ # create Resource in Openstack based VIM
+ if content.get("vim_type"):
+ if content["vim_type"] == "openstack":
+ compute = {
+ "ram": {
+ "total": None,
+ "used": None
+ },
+ "vcpus": {
+ "total": None,
+ "used": None
+ },
+ "instances": {
+ "total": None,
+ "used": None
+ }
+ }
+ storage = {
+ "volumes": {
+ "total": None,
+ "used": None
+ },
+ "snapshots": {
+ "total": None,
+ "used": None
+ },
+ "storage": {
+ "total": None,
+ "used": None
+ }
+ }
+ network = {
+ "networks": {
+ "total": None,
+ "used": None
+ },
+ "subnets": {
+ "total": None,
+ "used": None
+ },
+ "floating_ips": {
+ "total": None,
+ "used": None
+ }
+ }
+ content["resources"] = {"compute": compute, "storage": storage, "network": network}
except ValidationError as e:
raise EngineException(e, HTTPStatus.UNPROCESSABLE_ENTITY)
except ValidationError as e:
raise EngineException(e, HTTPStatus.UNPROCESSABLE_ENTITY)
- def show(self, session, _id, api_req=False):
+ def show(self, session, _id, filter_q=None, api_req=False):
"""
Get complete information on an topic
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param _id: server internal id or username
"""
Get complete information on an topic
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param _id: server internal id or username
:param api_req: True if this call is serving an external API request. False if serving internal request.
:return: dictionary, raise exception if not found.
"""
:param api_req: True if this call is serving an external API request. False if serving internal request.
:return: dictionary, raise exception if not found.
"""
"_id": _id,
"username": indata.get("username"),
"password": indata.get("password"),
"_id": _id,
"username": indata.get("username"),
"password": indata.get("password"),
"add_project_role_mappings": mappings_to_add,
"remove_project_role_mappings": mappings_to_remove,
}
"add_project_role_mappings": mappings_to_add,
"remove_project_role_mappings": mappings_to_remove,
}
except ValidationError as e:
raise EngineException(e, HTTPStatus.UNPROCESSABLE_ENTITY)
except ValidationError as e:
raise EngineException(e, HTTPStatus.UNPROCESSABLE_ENTITY)
- def show(self, session, _id, api_req=False):
+ def show(self, session, _id, filter_q=None, api_req=False):
"""
Get complete information on an topic
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param _id: server internal id
"""
Get complete information on an topic
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param _id: server internal id
:param api_req: True if this call is serving an external API request. False if serving internal request.
:return: dictionary, raise exception if not found.
"""
:param api_req: True if this call is serving an external API request. False if serving internal request.
:return: dictionary, raise exception if not found.
"""
- def show(self, session, _id, api_req=False):
+ def show(self, session, _id, filter_q=None, api_req=False):
"""
Get complete information on an topic
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param _id: server internal id
"""
Get complete information on an topic
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param _id: server internal id
:param api_req: True if this call is serving an external API request. False if serving internal request.
:return: dictionary, raise exception if not found.
"""
:param api_req: True if this call is serving an external API request. False if serving internal request.
:return: dictionary, raise exception if not found.
"""