Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(44)  |  Call(44)  |  Derive(0)  |  Import(0)

src/p/y/python-ceilometerclient-1.0.10/ceilometerclient/v2/shell.py   python-ceilometerclient(Download)
        aggregates.append(dict(zip(('func', 'param'), a.split("<-"))))
    api_args = {'meter_name': args.meter,
                'q': options.cli_to_array(args.query),
                'period': args.period,
                'groupby': args.groupby,
def do_sample_list(cc, args):
    '''List the samples for a meter.'''
    fields = {'meter_name': args.meter,
              'q': options.cli_to_array(args.query),
              'limit': args.limit}
def do_meter_list(cc, args={}):
    '''List the user's meters.'''
    meters = cc.meters.list(q=options.cli_to_array(args.query))
    field_labels = ['Name', 'Type', 'Unit', 'Resource ID', 'User ID',
                    'Project ID']
def do_alarm_list(cc, args={}):
    '''List the user's alarms.'''
    alarms = cc.alarms.list(q=options.cli_to_array(args.query))
    # omit action initially to keep output width sane
    # (can switch over to vertical formatting when available from CLIFF)
    if 'query' in fields['threshold_rule']:
        fields['threshold_rule']['query'] = options.cli_to_array(
            fields['threshold_rule']['query'])
    alarm = cc.alarms.create(**fields)
    _display_alarm(alarm)

src/p/y/python-ceilometerclient-HEAD/ceilometerclient/v2/shell.py   python-ceilometerclient(Download)
        aggregates.append(dict(zip(('func', 'param'), a.split("<-"))))
    api_args = {'meter_name': args.meter,
                'q': options.cli_to_array(args.query),
                'period': args.period,
                'groupby': args.groupby,
def do_sample_list(cc, args):
    '''List the samples for a meter.'''
    fields = {'meter_name': args.meter,
              'q': options.cli_to_array(args.query),
              'limit': args.limit}
def do_meter_list(cc, args={}):
    '''List the user's meters.'''
    meters = cc.meters.list(q=options.cli_to_array(args.query))
    field_labels = ['Name', 'Type', 'Unit', 'Resource ID', 'User ID',
                    'Project ID']
def do_alarm_list(cc, args={}):
    '''List the user's alarms.'''
    alarms = cc.alarms.list(q=options.cli_to_array(args.query))
    # omit action initially to keep output width sane
    # (can switch over to vertical formatting when available from CLIFF)
    if 'query' in fields['threshold_rule']:
        fields['threshold_rule']['query'] = options.cli_to_array(
            fields['threshold_rule']['query'])
    alarm = cc.alarms.create(**fields)
    _display_alarm(alarm)

src/p/y/python-ceilometerclient-1.0.10/ceilometerclient/tests/v2/test_options.py   python-ceilometerclient(Download)
    def test_one(self):
        ar = options.cli_to_array('this<=34')
        self.assertEqual(ar, [{'field': 'this', 'op': 'le',
                               'value': '34', 'type': ''}])
 
    def test_two(self):
        ar = options.cli_to_array('this<=34;that!=foo')
    def test_negative(self):
        ar = options.cli_to_array('this>=-783')
        self.assertEqual(ar, [{'field': 'this', 'op': 'ge',
                               'value': '-783', 'type': ''}])
 
    def test_float(self):
        ar = options.cli_to_array('this<=283.347')
    def test_with_dot(self):
        ar = options.cli_to_array('metadata.this<=34')
        self.assertEqual(ar, [{'field': 'metadata.this',
                               'op': 'le', 'value': '34',
                               'type': ''}])

src/p/y/python-ceilometerclient-HEAD/ceilometerclient/tests/v2/test_options.py   python-ceilometerclient(Download)
    def test_one(self):
        ar = options.cli_to_array('this<=34')
        self.assertEqual(ar, [{'field': 'this', 'op': 'le',
                               'value': '34', 'type': ''}])
 
    def test_two(self):
        ar = options.cli_to_array('this<=34;that!=foo')
    def test_negative(self):
        ar = options.cli_to_array('this>=-783')
        self.assertEqual(ar, [{'field': 'this', 'op': 'ge',
                               'value': '-783', 'type': ''}])
 
    def test_float(self):
        ar = options.cli_to_array('this<=283.347')
    def test_with_dot(self):
        ar = options.cli_to_array('metadata.this<=34')
        self.assertEqual(ar, [{'field': 'metadata.this',
                               'op': 'le', 'value': '34',
                               'type': ''}])