• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.populate_params_from_cli_args函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中myrally.test_client.utils.populate_params_from_cli_args函数的典型用法代码示例。如果您正苦于以下问题:Python populate_params_from_cli_args函数的具体用法?Python populate_params_from_cli_args怎么用?Python populate_params_from_cli_args使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了populate_params_from_cli_args函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: create_resource_based_policy

 def create_resource_based_policy(self, args):
     params, parser, args = utility(args)
     parser.add_argument('--policy-document', required = True)
     args = parser.parse_args(args)
     utils.populate_params_from_cli_args(params, args)
     return requestify.make_request(self.url, self.verb, self.headers,
                                     params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:7,代码来源:iam.py


示例2: get_password_data

def get_password_data(url, verb, headers, version, args):
    params = {}
    params['Action'] = utils.dash_to_camelcase(args[0])
    params['Version'] = version
    args = args[1:]
    parser = utils.get_argument_parser()
    parser.add_argument('--instance-id', required=True)
    processed, remaining = parser.parse_known_args(args)
    utils.populate_params_from_cli_args(params, processed)
    response = requestify.make_request(url, verb, headers, params)
    parser = utils.get_argument_parser()
    parser.add_argument('--private-key-file', required=False, default=None)
    parser.add_argument('--key-passphrase', required=False, default=None)
    processed = parser.parse_args(remaining)
    processed = vars(processed)
    private_key_file = processed.get('private_key_file')
    passphrase = processed.get('key_passphrase')
    response_json = utils.web_response_to_json(response)
    try:
        response_body = response_json['GetPasswordDataResponse']
        encrypted_password = response_body['passwordData']
        if not private_key_file or not encrypted_password:
            return response
        decrypted_password = decrypt_instance_password(encrypted_password,
                                                       private_key_file,
                                                       passphrase)
        response_json['GetPasswordDataResponse']['passwordData'] = \
                                                  decrypted_password
        return response_json
    except KeyError as ke:
        raise exception.UnknownOutputFormat()
开发者ID:hmdesai89,项目名称:myrally,代码行数:31,代码来源:instance.py


示例3: create_group

 def create_group(self, args):
     params, parser, args = utility(args)
     parser.add_argument('--name', required = True)
     parser.add_argument('--description')
     args = parser.parse_args(args)
     utils.populate_params_from_cli_args(params, args)
     return requestify.make_request(self.url, self.verb, self.headers,
                                    params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:8,代码来源:iam.py


示例4: create_user

 def create_user(self, args):
     params, parser, args = utility(args)
     parser.add_argument('--name', required = True)
     parser.add_argument('--email')
     parser.add_argument('--password')
     args = parser.parse_args(args)
     utils.populate_params_from_cli_args(params, args)
     return requestify.make_request(self.url, self.verb, self.headers,
                                    params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:9,代码来源:iam.py


示例5: show_delete_on_termination_flag

def show_delete_on_termination_flag(url, verb, headers, version, args):
    params = {}
    params['Action'] = utils.dash_to_camelcase(args[0])
    params['Version'] = version
    args = args[1:]
    parser = utils.get_argument_parser()
    parser.add_argument('--volume-id', required=True)
    args = parser.parse_args(args)
    utils.populate_params_from_cli_args(params, args)
    return requestify.make_request(url, verb, headers, params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:10,代码来源:volume.py


示例6: get_user_credential

 def get_user_credential(self, args):
     params, parser, args = utility(args)
     parser.add_argument('--user-name')
     parser.add_argument('--user-id')
     args = parser.parse_args(args)
     if args.user_name is None and args.user_id is None:
         parser.error("at least one of --user-name and --user-id required")
     utils.populate_params_from_cli_args(params, args)
     return requestify.make_request(self.url, self.verb, self.headers,
                                    params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:10,代码来源:iam.py


示例7: delete_credential

 def delete_credential(self, args):
     params, parser, args = utility(args)
     parser.add_argument('--access-key')
     parser.add_argument('--id')
     args = parser.parse_args(args)
     if args.access_key is None and args.id is None:
         parser.error("at least one of --access-key and --id required")
     utils.populate_params_from_cli_args(params, args)
     return requestify.make_request(self.url, self.verb, self.headers,
                                    params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:10,代码来源:iam.py


示例8: modify_db_instance

def modify_db_instance(url, verb, headers, version, args):
    params = {}
    params['Action'] = utils.dash_to_camelcase(args[0])
    params['Version'] = version
    args = args[1:]
    parser = utils.get_argument_parser()
    parser.add_argument('--db-instance-identifier', required=True)
    args = parser.parse_args(args)
    utils.populate_params_from_cli_args(params, args)
    return requestify.make_request(url, verb, headers, params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:10,代码来源:rds.py


示例9: describe_images

def describe_images(url, verb, headers, version, args):
    params = {}
    params['Action'] = utils.dash_to_camelcase(args[0])
    params['Version'] = version
    args = args[1:]
    parser = utils.get_argument_parser()
    parser.add_argument('--image-ids', nargs='+', required=False)
    args = parser.parse_args(args)
    utils.populate_params_from_cli_args(params, args)
    return requestify.make_request(url, verb, headers, params) 
开发者ID:hmdesai89,项目名称:myrally,代码行数:10,代码来源:image.py


示例10: delete_user

 def delete_user(self, args):
     params, parser, args = utility(args)
     parser.add_argument('--name', required = False)
     parser.add_argument('--id', required = False)
     args = parser.parse_args(args)
     if args.name is None and args.id is None:
         parser.error("at least one of --name and --id required")
     utils.populate_params_from_cli_args(params, args)
     return requestify.make_request(self.url, self.verb, self.headers,
                                    params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:10,代码来源:iam.py


示例11: get_resource_based_policy_summary

 def get_resource_based_policy_summary(self, args):
     params, parser, args = utility(args)
     parser.add_argument('--name')
     parser.add_argument('--id')
     args = parser.parse_args(args)
     if args.name is None and args.id is None:
         parser.error("at least one of --name and --id required")
     utils.populate_params_from_cli_args(params, args)
     return requestify.make_request(self.url, self.verb, self.headers,
                                     params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:10,代码来源:iam.py


示例12: detach_policy_from_resource

 def detach_policy_from_resource(self, args):
     params, parser, args = utility(args)
     parser.add_argument('--policy-name')
     parser.add_argument('--policy-id')
     parser.add_argument('--policy-document', required = True)
     args = parser.parse_args(args)
     if args.policy_name is None and args.policy_id is None:
         parser.error("at least one of --policy-name and --policy-id required")
     utils.populate_params_from_cli_args(params, args)
     return requestify.make_request(self.url, self.verb, self.headers,
                                     params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:11,代码来源:iam.py


示例13: release_address

def release_address(url, verb, headers, version, args):

    params = {}
    params['Action'] = utils.dash_to_camelcase(args[0])
    params['Version'] = version
    args = args[1:]
    parser = utils.get_argument_parser()
    parser.add_argument('--allocation-id',required=True)
    args = parser.parse_args(args)
    utils.populate_params_from_cli_args(params, args)
    return requestify.make_request(url, verb, headers, params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:11,代码来源:com.py


示例14: create_volume

def create_volume(url, verb, headers, version, args):
    params = {}
    params['Action'] = utils.dash_to_camelcase(args[0])
    params['Version'] = version
    args = args[1:]
    parser = utils.get_argument_parser()
    parser.add_argument('--size', type=int, required=False)
    parser.add_argument('--snapshot-id', required=False)
    args = parser.parse_args(args)
    utils.populate_params_from_cli_args(params, args)
    return requestify.make_request(url, verb, headers, params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:11,代码来源:volume.py


示例15: associate_route_table

def associate_route_table(url, verb, headers, version, args):

    params = {}
    params['Action'] = utils.dash_to_camelcase(args[0])
    params['Version'] = version
    args = args[1:]
    parser = utils.get_argument_parser()
    parser.add_argument('--route-table-id',required=True)
    parser.add_argument('--subnet-id',required=True)
    args = parser.parse_args(args)
    utils.populate_params_from_cli_args(params, args)
    return requestify.make_request(url, verb, headers, params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:12,代码来源:com.py


示例16: detach_volume

def detach_volume(url, verb, headers, version, args):
    params = {}
    params['Action'] = utils.dash_to_camelcase(args[0])
    params['Version'] = version
    args = args[1:]
    parser = utils.get_argument_parser()
    parser.add_argument('--instance-id', required=False)
    parser.add_argument('--volume-id', required=True)
    parser.add_argument('--force', type=bool, required=False)
    args = parser.parse_args(args)
    utils.populate_params_from_cli_args(params, args)
    return requestify.make_request(url, verb, headers, params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:12,代码来源:volume.py


示例17: describe_volumes

def describe_volumes(url, verb, headers, version, args):
    params = {}
    params['Action'] = utils.dash_to_camelcase(args[0])
    params['Version'] = version
    args = args[1:]
    parser = utils.get_argument_parser()
    parser.add_argument('--volume-ids', nargs='+', required=False)
    parser.add_argument('--max-results', type=int, required=False)
    parser.add_argument('--next-token', required=False)
    parser.add_argument('--detail', type=bool, required=False)
    args = parser.parse_args(args)
    utils.populate_params_from_cli_args(params, args)
    return requestify.make_request(url, verb, headers, params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:13,代码来源:volume.py


示例18: describe_instances

def describe_instances(url, verb, headers, version, args):
    params = {}
    params['Action'] = utils.dash_to_camelcase(args[0])
    params['Version'] = version
    args = args[1:]
    parser = utils.get_argument_parser()
    parser.add_argument('--instance-ids', nargs='+', required=False)
    # Right now filters functionality is broken, it works only
    # for cases like --filters "Name=abc,Values=def"
    parser.add_argument('--filters', nargs='+', required=False)
    args = parser.parse_args(args)
    utils.populate_params_from_cli_args(params, args)
    return requestify.make_request(url, verb, headers, params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:13,代码来源:instance.py


示例19: attach_policy_to_group

 def attach_policy_to_group(self, args):
     params, parser, args = utility(args)
     parser.add_argument('--group-name')
     parser.add_argument('--group-id')
     parser.add_argument('--policy-name')
     parser.add_argument('--policy-id')
     args = parser.parse_args(args)
     if args.group_name is None and args.group_id is None:
         parser.error("at least one of --group-name and --group-id required")
     if args.policy_name is None and args.policy_id is None:
         parser.error("at least one of --policy-name and --policy-id required")
     utils.populate_params_from_cli_args(params, args)
     return requestify.make_request(self.url, self.verb, self.headers,
                                     params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:14,代码来源:iam.py


示例20: update_group

 def update_group(self, args):
     params, parser, args = utility(args)
     parser.add_argument('--name')
     parser.add_argument('--id')
     parser.add_argument('--new-name')
     parser.add_argument('--new-description')
     args = parser.parse_args(args)
     if args.name is None and args.id is None:
         parser.error("at least one of --name and --id required")
     if args.new_name is None and args.new_description is None:
         parser.error("at least one of --new-name and --new-description is required")
     utils.populate_params_from_cli_args(params, args)
     return requestify.make_request(self.url, self.verb, self.headers,
                                     params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:14,代码来源:iam.py



注:本文中的myrally.test_client.utils.populate_params_from_cli_args函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python regex_expose.findall函数代码示例发布时间:2022-05-27
下一篇:
Python requestify.make_request函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap