Beispiel #1
0
 def openstack_formatting(data, uuid):
     data["links"] = get_autoscale_links(self.tenant_id, uuid)
     data["state"] = format_state_dict(data["state"])
     linkify_policy_list(data["scalingPolicies"], self.tenant_id, uuid)
     data['scalingPolicies_links'] = get_policies_links(
         data['scalingPolicies'], self.tenant_id, uuid, rel='policies')
     return {"group": data}
Beispiel #2
0
 def _format_output(result):
     uuid = result['id']
     result["state"] = format_state_dict(result["state"])
     request.setHeader(
         "Location", get_autoscale_links(self.tenant_id, uuid, format=None))
     result["links"] = get_autoscale_links(self.tenant_id, uuid)
     linkify_policy_list(result['scalingPolicies'], self.tenant_id, uuid)
     result['scalingPolicies_links'] = get_policies_links(
         result['scalingPolicies'], self.tenant_id, uuid, rel='policies')
     return {"group": result}
Beispiel #3
0
 def openstack_formatting(results):
     data, active = results
     data["links"] = get_autoscale_links(self.tenant_id, self.group_id)
     data["state"] = format_state_dict(data["state"], active)
     linkify_policy_list(
         data["scalingPolicies"], self.tenant_id, self.group_id)
     data['scalingPolicies_links'] = get_policies_links(
         data['scalingPolicies'], self.tenant_id, self.group_id,
         rel='policies')
     if with_webhooks(request):
         add_webhooks_links(data["scalingPolicies"])
     return {"group": data}
Beispiel #4
0
 def openstack_formatting(results):
     data, active = results
     data["links"] = get_autoscale_links(self.tenant_id, self.group_id)
     data["state"] = format_state_dict(data["state"], active)
     linkify_policy_list(
         data["scalingPolicies"], self.tenant_id, self.group_id)
     data['scalingPolicies_links'] = get_policies_links(
         data['scalingPolicies'], self.tenant_id, self.group_id,
         rel='policies')
     if with_webhooks(request):
         add_webhooks_links(data["scalingPolicies"])
     return {"group": data}
Beispiel #5
0
 def _format_output(result):
     uuid = result['id']
     result["state"] = format_state_dict(result["state"])
     request.setHeader(
         "Location",
         get_autoscale_links(self.tenant_id, uuid, format=None))
     result["links"] = get_autoscale_links(self.tenant_id, uuid)
     linkify_policy_list(
         result['scalingPolicies'], self.tenant_id, uuid)
     result['scalingPolicies_links'] = get_policies_links(
         result['scalingPolicies'],
         self.tenant_id, uuid, rel='policies')
     return {"group": result}