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
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
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
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
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
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