Пример #1
0
def run_update(opts):
    sess = session.make_session(opts)
    cls = common.find_resource_cls(opts)
    obj = cls.new(**common.get_data_option(opts))
    obj.update(sess)
    print(str(obj))
    return
Пример #2
0
def run_update(opts):
    sess = session.make_session(opts)
    cls = common.find_resource_cls(opts)
    obj = cls.new(**common.get_data_option(opts))
    obj.update(sess)
    print(str(obj))
    return
Пример #3
0
def run_head(opts):
    sess = session.make_session(opts)
    cls = common.find_resource_cls(opts)
    data = common.get_data_option(opts)
    obj = cls.new(**data)
    obj.head(sess)
    print(str(obj))
    return
Пример #4
0
def run_delete(opts):
    sess = session.make_session(opts)
    cls = common.find_resource_cls(opts)
    data = common.get_data_option(opts)
    obj = cls.new(**data)
    obj.delete(sess)
    print('Deleted: %s' % str(data))
    return
Пример #5
0
def run_head(opts):
    sess = session.make_session(opts)
    cls = common.find_resource_cls(opts)
    data = common.get_data_option(opts)
    obj = cls.new(**data)
    obj.head(sess)
    print(str(obj))
    return
Пример #6
0
def run_list(opts):
    sess = session.make_session(opts)
    cls = common.find_resource_cls(opts)
    path_args = None
    if opts.data:
        path_args = common.get_data_option(opts)
    for obj in cls.list(sess, path_args=path_args):
        print(str(obj))
    return
Пример #7
0
def run_action(options):
    sess = session.make_session(options)
    cls = common.find_resource_cls(options)
    data = common.get_data_option(options)

    action = data.pop('action')
    if 'action_args' in data:
        args = data.pop('action_args')
    else:
        args = {}
    args.update(session=sess)

    obj = cls.new(**data)
    reply = invoke_method(obj, action, args)
    print(str(reply))
    return
Пример #8
0
def run_find(opts):
    sess = session.make_session(opts)
    cls = common.find_resource_cls(opts)
    obj = cls.find(sess, opts.data)
    print(str(obj))
    return
Пример #9
0
def run_find(opts):
    sess = session.make_session(opts)
    cls = common.find_resource_cls(opts)
    obj = cls.find(sess, opts.data)
    print(str(obj))
    return