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


Python awsrequest.create_request_object方法代码示例

本文整理汇总了Python中botocore.awsrequest.create_request_object方法的典型用法代码示例。如果您正苦于以下问题:Python awsrequest.create_request_object方法的具体用法?Python awsrequest.create_request_object怎么用?Python awsrequest.create_request_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在botocore.awsrequest的用法示例。


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

示例1: generate_presigned_url

# 需要导入模块: from botocore import awsrequest [as 别名]
# 或者: from botocore.awsrequest import create_request_object [as 别名]
def generate_presigned_url(self, request_dict, operation_name,
                               expires_in=3600, region_name=None):
        """Generates a presigned url

        :type request_dict: dict
        :param request_dict: The prepared request dictionary returned by
            ``botocore.awsrequest.prepare_request_dict()``

        :type operation_name: str
        :param operation_name: The operation being signed.

        :type expires_in: int
        :param expires_in: The number of seconds the presigned url is valid
            for. By default it expires in an hour (3600 seconds)

        :type region_name: string
        :param region_name: The region name to sign the presigned url.

        :returns: The presigned url
        """
        request = create_request_object(request_dict)
        self.sign(operation_name, request, region_name,
                  'presign-url', expires_in)

        request.prepare()
        return request.url 
开发者ID:skarlekar,项目名称:faces,代码行数:28,代码来源:signers.py

示例2: create_request

# 需要导入模块: from botocore import awsrequest [as 别名]
# 或者: from botocore.awsrequest import create_request_object [as 别名]
def create_request(self, params, operation_model=None):
        request = create_request_object(params)
        if operation_model:
            event_name = 'request-created.{endpoint_prefix}.{op_name}'.format(
                endpoint_prefix=self._endpoint_prefix,
                op_name=operation_model.name)
            self._event_emitter.emit(event_name, request=request,
                                     operation_name=operation_model.name)
        prepared_request = self.prepare_request(request)
        return prepared_request 
开发者ID:skarlekar,项目名称:faces,代码行数:12,代码来源:endpoint.py

示例3: generate_presigned_url

# 需要导入模块: from botocore import awsrequest [as 别名]
# 或者: from botocore.awsrequest import create_request_object [as 别名]
def generate_presigned_url(self, request_dict, operation_name,
                               expires_in=3600, region_name=None,
                               signing_name=None):
        """Generates a presigned url

        :type request_dict: dict
        :param request_dict: The prepared request dictionary returned by
            ``botocore.awsrequest.prepare_request_dict()``

        :type operation_name: str
        :param operation_name: The operation being signed.

        :type expires_in: int
        :param expires_in: The number of seconds the presigned url is valid
            for. By default it expires in an hour (3600 seconds)

        :type region_name: string
        :param region_name: The region name to sign the presigned url.

        :type signing_name: str
        :param signing_name: The name to use for the service when signing.

        :returns: The presigned url
        """
        request = create_request_object(request_dict)
        self.sign(operation_name, request, region_name,
                  'presign-url', expires_in, signing_name)

        request.prepare()
        return request.url 
开发者ID:QData,项目名称:deepWordBug,代码行数:32,代码来源:signers.py

示例4: create_request

# 需要导入模块: from botocore import awsrequest [as 别名]
# 或者: from botocore.awsrequest import create_request_object [as 别名]
def create_request(self, params, operation_model=None):
        request = create_request_object(params)
        if operation_model:
            request.stream_output = any([
                operation_model.has_streaming_output,
                operation_model.has_event_stream_output
            ])
            service_id = operation_model.service_model.service_id.hyphenize()
            event_name = 'request-created.{service_id}.{op_name}'.format(
                service_id=service_id,
                op_name=operation_model.name)
            self._event_emitter.emit(event_name, request=request,
                                     operation_name=operation_model.name)
        prepared_request = self.prepare_request(request)
        return prepared_request 
开发者ID:QData,项目名称:deepWordBug,代码行数:17,代码来源:endpoint.py

示例5: _create_prepared_request

# 需要导入模块: from botocore import awsrequest [as 别名]
# 或者: from botocore.awsrequest import create_request_object [as 别名]
def _create_prepared_request(
        self,
        params: Dict,
        operation_model: Optional[Any],
    ) -> AWSPreparedRequest:
        request = create_request_object(params)
        self._sign_request(request)
        prepared_request = self.client._endpoint.prepare_request(request)
        if self._extra_headers is not None:
            prepared_request.headers.update(self._extra_headers)
        return prepared_request 
开发者ID:pynamodb,项目名称:PynamoDB,代码行数:13,代码来源:base.py


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