Exemple #1
0
 def measures_list(cls, resource_id=None, metric_name=None, param=None):
     url = cls.format_url() + settings.measures_list_url.format(
         resource_id=resource_id, metric_name=metric_name, query=param)
     response = RequestMethod.get(url=url)
     print "status_code: %s" % response.status_code
     content = json.loads(response.content)
     return content
Exemple #2
0
 def resource_detail(cls, resource_id=None):
     url = cls.format_url() + settings.resource_detail_url.format(
         resource_id=resource_id)
     response = RequestMethod.get(url=url)
     print "status_code: %s" % response.status_code
     content = json.loads(response.content)
     return content
Exemple #3
0
 def measure_detail(cls, metric_id=None, param=None):
     url = cls.format_url() + settings.measure_detail_url.format(
         metric_id=metric_id, query=param)
     response = RequestMethod.get(url=url)
     print "status_code: %s" % response.status_code
     content = json.loads(response.content)
     return content
Exemple #4
0
 def list_stacks(cls, tenant_id=None):
     url = cls.format_url() + settings.list_stacks_url.format(
         tenant_id=tenant_id)
     response = RequestMethod.get(url=url)
     print "status_code: %s" % response.status_code
     content = json.loads(response.content)
     return content
Exemple #5
0
 def validate_template(cls, tenant_id=None):
     url = cls.format_url() + settings.template_versions_list_url.format(
         tenant_id=tenant_id)
     response = RequestMethod.get(url=url)
     print "status_code: %s" % response.status_code
     content = json.loads(response.content)
     return content
Exemple #6
0
 def suspend_stack(cls, tenant_id=None, stack_name=None, stack_id=None):
     url = cls.format_url() + settings.suspend_stack_url.format(
         tenant_id=tenant_id,
         stack_name=stack_name,
         stack_id=stack_id,
     )
     response = RequestMethod.post(url=url, data={'suspend': ''})
     print "status_code: %s" % response.status_code
     return response.content
Exemple #7
0
 def show_stacks_details(cls,
                         tenant_id=None,
                         stack_name=None,
                         stack_id=None):
     url = cls.format_url() + settings.show_stack_details_url.format(
         tenant_id=tenant_id, stack_name=stack_name, stack_id=stack_id)
     response = RequestMethod.get(url=url)
     print "status_code: %s" % response.status_code
     content = json.loads(response.content)
     return content
Exemple #8
0
 def resource_history(cls,
                      resource_type="generic",
                      resource_id=None,
                      history=None,
                      param=None):
     url = cls.format_url() + settings.resource_history_url.format(
         resource_type=resource_type,
         resource_id=resource_id,
         history=history,
         query=param)
     response = RequestMethod.get(url=url)
     print "status_code: %s" % response.status_code
     content = json.loads(response.content)
     return content
Exemple #9
0
 def resource_list(cls, param=None):
     url = cls.format_url() + settings.resource_list_url.format(query=param)
     response = RequestMethod.get(url=url)
     print "status_code: %s" % response.status_code
     content = json.loads(response.content)
     return content