+ container_list = [(c.name, c.getStatus()) for c in dcs.get(dc_label).listCompute()]
+ extSAP_list = [(sap.name, sap.getStatus()) for sap in dcs.get(dc_label).listExtSAPs()]
+ total_list = container_list + extSAP_list
+ return total_list, 200, CORS_HEADER
+ except Exception as ex:
+ logging.exception("API error.")
+ return ex.message, 500, CORS_HEADER
+
+class ComputeResources(Resource):
+ """
+ Update the container's resources using the docker.update function
+ re-using the same parameters:
+ url params:
+ blkio_weight
+ cpu_period, cpu_quota, cpu_shares
+ cpuset_cpus
+ cpuset_mems
+ mem_limit
+ mem_reservation
+ memswap_limit
+ kernel_memory
+ restart_policy
+ see https://docs.docker.com/engine/reference/commandline/update/
+ or API docs: https://docker-py.readthedocs.io/en/stable/api.html#module-docker.api.container
+ :param dc_label: name of the DC
+ :param compute_name: compute container name
+
+ :return: docker inspect dict of deployed docker
+ """
+ global dcs
+
+ def put(self, dc_label, compute_name):
+ logging.debug("REST CALL: update container resources")
+
+ try:
+ c = self._update_resources(dc_label, compute_name)
+ return c.getStatus(), 200, CORS_HEADER