Ejemplo n.º 1
0
    def create_ssl(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
        """CreateSSL - 创建SSL证书,可以把整个 Pem 证书内容传过来,或者把证书、私钥、CA证书分别传过来

        **Request**

        - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
        - **Region** (str) - (Config) 地域。 参见  `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
        - **SSLName** (str) - (Required) SSL证书的名字,默认值为空
        - **CaCert** (str) - CA证书
        - **PrivateKey** (str) - 加密证书的私钥
        - **SSLContent** (str) - SSL证书的完整内容,包括用户证书、加密证书的私钥、CA证书
        - **SSLType** (str) - 所添加的SSL证书类型,目前只支持Pem格式
        - **UserCert** (str) - 用户的证书

        **Response**

        - **SSLId** (str) - SSL证书的Id

        """
        # build request
        d = {"ProjectId": self.config.project_id, "Region": self.config.region}
        req and d.update(req)
        d = apis.CreateSSLRequestSchema().dumps(d)

        # build options
        kwargs["max_retries"] = 0  # ignore retry when api is not idempotent

        resp = self.invoke("CreateSSL", d, **kwargs)
        return apis.CreateSSLResponseSchema().loads(resp)
Ejemplo n.º 2
0
    def create_ssl(self, req=None, **kwargs):
        """ CreateSSL - 创建SSL证书,可以把整个 Pem 证书内容传过来,或者把证书、私钥、CA证书分别传过来

        :param ProjectId: (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
        :param Region: (Config) 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
        :param SSLName: (Required) SSL证书的名字,默认值为空
        :param CaCert: (Optional) CA证书
        :param PrivateKey: (Optional) 加密证书的私钥
        :param SSLContent: (Optional) SSL证书的完整内容,包括用户证书、加密证书的私钥、CA证书
        :param SSLType: (Optional) 所添加的SSL证书类型,目前只支持Pem格式
        :param UserCert: (Optional) 用户的证书
        """
        d = {"ProjectId": self.config.project_id, "Region": self.config.region}
        req and d.update(req)
        d = apis.CreateSSLRequestSchema().dumps(d)
        kwargs["max_retries"] = 0
        resp = self.invoke("CreateSSL", d, **kwargs)
        return apis.CreateSSLResponseSchema().loads(resp)