当前位置: 首页>>代码示例>>Python>>正文


Python requestify.make_request函数代码示例

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


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

示例1: 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

示例2: 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

示例3: revoke_security_group_egress

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

    params = {}
    params['Action'] = utils.dash_to_camelcase(args[0])
    params['Version'] = version
    args = args[1:]
    create_sec_group_rule(params,args)
    return requestify.make_request(url, verb, headers, params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:8,代码来源:com.py

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: create_vpc

def create_vpc(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('--cidr-block',required=True)
    args = parser.parse_args(args)
    vpcutils.populate_params_from_cli_args(params, args)
    return requestify.make_request(url, verb, headers, params)
开发者ID:hmdesai89,项目名称:myrally,代码行数:11,代码来源:com.py

示例15: 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


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