connection.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:cuny-bdif 作者: aristotle-tek 项目源码 文件源码
def create_health_check(self, health_check, caller_ref=None):
        """
        Create a new Health Check

        :type health_check: HealthCheck
        :param health_check: HealthCheck object

        :type caller_ref: str
        :param caller_ref: A unique string that identifies the request
            and that allows failed CreateHealthCheckRequest requests to be retried
            without the risk of executing the operation twice.  If you don't
            provide a value for this, boto will generate a Type 4 UUID and
            use that.

        """
        if caller_ref is None:
            caller_ref = str(uuid.uuid4())
        uri = '/%s/healthcheck' % self.Version
        params = {'xmlns': self.XMLNameSpace,
                  'caller_ref': caller_ref,
                  'health_check': health_check.to_xml()
                  }
        xml_body = self.POSTHCXMLBody % params
        response = self.make_request('POST', uri, {'Content-Type': 'text/xml'}, xml_body)
        body = response.read()
        boto.log.debug(body)
        if response.status == 201:
            e = boto.jsonresponse.Element()
            h = boto.jsonresponse.XmlHandler(e, None)
            h.parse(body)
            return e
        else:
            raise exception.DNSServerError(response.status, response.reason, body)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号