def get_resources(self, **kwargs):
     '''
     Get resource list from Ceilometer API
     :param kwargs: (Dict) filters.
     :return:
     '''
     url_para_obj = kwargs_to_url_parameter_object(**kwargs)
     return self.ceilometer_conn.get_data('resources', method='GET', url_parameters=url_para_obj)
 def get_alarms(self, **kwargs):
     '''
     Get alarm list from Ceilometer
     :param kwargs:
     :return:
     '''
     url_para_obj = kwargs_to_url_parameter_object(**kwargs)
     return self.ceilometer_conn.get_data('alarms', method='GET', url_parameters=url_para_obj)
 def get_meters(self, **kwargs):
     '''
     Get meter list from ceilometer api
     :param kwargs: (Dict) filter criteria
     :return:
     '''
     url_para_obj = kwargs_to_url_parameter_object(**kwargs)
     return self.ceilometer_conn.get_data('meters', method='GET', url_parameters=url_para_obj)
 def get_resource_detail(self, **kwargs):
     '''
     Get detail of a specified resource
     :param kwargs: (Dict) search filters.
     :return:
     '''
     resource_id = kwargs.pop('resource_id', '')
     url_para_obj = kwargs_to_url_parameter_object(**kwargs)
     return self.ceilometer_conn.get_data('resources/' + resource_id, method='GET', url_parameters=url_para_obj)
Esempio n. 5
0
def get_resources(token, **kwargs):
    request_header = {
        'X-Auth-Token': token,
        'Content-Type': 'application/json'
    }
    url_para_obj = kwargs_to_url_parameter_object(**kwargs)
    return ceilometer_connection('resources',
                                 method='GET',
                                 header=request_header,
                                 url_parameters=url_para_obj)
Esempio n. 6
0
 def get_alarms(self, **kwargs):
     '''
     Get alarm list from Ceilometer
     :param kwargs:
     :return:
     '''
     url_para_obj = kwargs_to_url_parameter_object(**kwargs)
     return self.ceilometer_conn.get_data('alarms',
                                          method='GET',
                                          url_parameters=url_para_obj)
Esempio n. 7
0
 def get_meters(self, **kwargs):
     '''
     Get meter list from ceilometer api
     :param kwargs: (Dict) filter criteria
     :return:
     '''
     url_para_obj = kwargs_to_url_parameter_object(**kwargs)
     return self.ceilometer_conn.get_data('meters',
                                          method='GET',
                                          url_parameters=url_para_obj)
Esempio n. 8
0
 def get_resources(self, **kwargs):
     '''
     Get resource list from Ceilometer API
     :param kwargs: (Dict) filters.
     :return:
     '''
     url_para_obj = kwargs_to_url_parameter_object(**kwargs)
     return self.ceilometer_conn.get_data('resources',
                                          method='GET',
                                          url_parameters=url_para_obj)
Esempio n. 9
0
def get_meters(token, **kwargs):
    '''
    Get meter list from ceilometer api
    :param token: (string) token issued by Keystone
    :param kwargs: (Dict) filter criteria
    :return:
    '''
    request_header = {'X-Auth-Token': token, 'Content-Type': 'application/json'}
    url_para_obj = kwargs_to_url_parameter_object(**kwargs)
    return ceilometer_connection('meters', method='GET', header=request_header, url_parameters=url_para_obj)
Esempio n. 10
0
def get_alarms(token, **kwargs):
    '''
    Get alarm list from Ceilometer
    :param token: (string) OpenStack Keystone token
    :param kwargs:
    :return:
    '''
    request_header = {'X-Auth-Token': token,
                      'Content-Type': 'application/json'}
    url_para_obj = kwargs_to_url_parameter_object(**kwargs)
    return ceilometer_connection('alarms', method='GET', header=request_header, url_parameters=url_para_obj)
Esempio n. 11
0
 def get_resource_detail(self, **kwargs):
     '''
     Get detail of a specified resource
     :param kwargs: (Dict) search filters.
     :return:
     '''
     resource_id = kwargs.pop('resource_id', '')
     url_para_obj = kwargs_to_url_parameter_object(**kwargs)
     return self.ceilometer_conn.get_data('resources/' + resource_id,
                                          method='GET',
                                          url_parameters=url_para_obj)
Esempio n. 12
0
 def get_samples(self, meter_name, **kwargs):
     '''
     Get samples of a selected meter
     :param meter_name: (string)
     :param kwargs: (Dict) Query criteria,
                     e.g. ['meter_name': <meter_name>, 'resource_id': <resource_id>]
     :return:
     '''
     kwargs['limit'] = 500
     url_para_obj = kwargs_to_url_parameter_object(**kwargs)
     return self.ceilometer_conn.get_data('meters/' + meter_name,
                                          method='GET',
                                          url_parameters=url_para_obj)
Esempio n. 13
0
 def get_samples(self, meter_name, **kwargs):
     '''
     Get samples of a selected meter
     :param meter_name: (string)
     :param kwargs: (Dict) Query criteria,
                     e.g. ['meter_name': <meter_name>, 'resource_id': <resource_id>]
     :return:
     '''
     kwargs['limit'] = 500
     url_para_obj = kwargs_to_url_parameter_object(**kwargs)
     return self.ceilometer_conn.get_data('meters/' + meter_name,
                                          method='GET',
                                          url_parameters=url_para_obj)
Esempio n. 14
0
def get_samples(token, meter_name, **kwargs):
    '''
    Get samples of a selected meter
    :param token: (string) token issued by Keystone
    :param meter_name: (string)
    :param kwargs: (Dict) Query criteria,
                    e.g. ['meter_name': <meter_name>, 'resource_id': <resource_id>]
    :return:
    '''
    request_header = {'X-Auth-Token': token, 'Content-Type': 'application/json'}
    kwargs['limit'] = 500
    url_para_obj = kwargs_to_url_parameter_object(**kwargs)
    return ceilometer_connection('meters/' + meter_name,
                                 method='GET',
                                 header=request_header,
                                 url_parameters=url_para_obj)['data']
Esempio n. 15
0
def get_alarms(token, **kwargs):
    '''
    Get alarm list from Ceilometer
    :param token: (string) OpenStack Keystone token
    :param kwargs:
    :return:
    '''
    request_header = {
        'X-Auth-Token': token,
        'Content-Type': 'application/json'
    }
    url_para_obj = kwargs_to_url_parameter_object(**kwargs)
    return ceilometer_connection('alarms',
                                 method='GET',
                                 header=request_header,
                                 url_parameters=url_para_obj)
Esempio n. 16
0
def get_meters(token, **kwargs):
    '''
    Get meter list from ceilometer api
    :param token: (string) token issued by Keystone
    :param kwargs: (Dict) filter criteria
    :return:
    '''
    request_header = {
        'X-Auth-Token': token,
        'Content-Type': 'application/json'
    }
    url_para_obj = kwargs_to_url_parameter_object(**kwargs)
    return ceilometer_connection('meters',
                                 method='GET',
                                 header=request_header,
                                 url_parameters=url_para_obj)
Esempio n. 17
0
def get_samples(token, meter_name, **kwargs):
    '''
    Get samples of a selected meter
    :param token: (string) token issued by Keystone
    :param meter_name: (string)
    :param kwargs: (Dict) Query criteria,
                    e.g. ['meter_name': <meter_name>, 'resource_id': <resource_id>]
    :return:
    '''
    request_header = {
        'X-Auth-Token': token,
        'Content-Type': 'application/json'
    }
    kwargs['limit'] = 500
    url_para_obj = kwargs_to_url_parameter_object(**kwargs)
    return ceilometer_connection('meters/' + meter_name,
                                 method='GET',
                                 header=request_header,
                                 url_parameters=url_para_obj)['data']
Esempio n. 18
0
def get_resource_detail(token, **kwargs):
    request_header = {'X-Auth-Token': token, 'Content-Type': 'application/json'}
    resource_id = kwargs.pop('resource_id', '')
    url_para_obj = kwargs_to_url_parameter_object(**kwargs)
    return ceilometer_connection('resources/' + resource_id, method='GET', header=request_header, url_parameters=url_para_obj)