更新时间:2024-04-08 GMT+08:00

创建证书

功能介绍

为HTTPS协议创建证书。

URI

POST /v1.0/{project_id}/elbaas/certificate

表1 参数说明

参数

是否必选

参数类型

描述

project_id

String

项目ID。

name

String

  • 证书名称。
  • 取值范围:0-64个字符,只能包含中英文、数字、下划线、中划线。

description

String

  • 描述。
  • 取值范围:长度不大于128个字符,不能包含< >。

domain

String

  • 服务端证书所签域名
  • 取值范围:长度不大于254位的字符串,字符串只能包含英文字母、数字、“-”或“.”,必须以字母或数字开头。

certificate

String

  • HTTPS协议使用的证书内容。
  • 取值范围:PEM编码格式。

private_key

String

  • HTTPS协议使用的私钥。
  • 取值范围:PEM编码格式。

请求消息

  • 请求参数

  • 请求样例
    {
        "name": "cert-bky",
        "description": "certificate",
        "certificate": "-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJANoPUy2NktS6MA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwNjIyMDMyOTU5WhcNMTkwNjIyMDMyOTU5WjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEArmUUhzm5sxxVr/ku4+6cKqnKgZvDl+e/6CNCAq8YMZXTpJP64DjDPny9\n+8s9MbFabEG3HqjHSKh3b/Ew3FXr8LFa9YuWuAi3W9ii29sZsOwmzIfQhIOIaP1Y\nNR50DDjbAGTaxzRhV40ZKSOCkaUTvl3do5d8ttD1VlF2r0w0DfclrVcsS5v3kw88\n9gJ3s3hNkatfQiSt4qLNMehZ8Xofx58DIAOk/f3Vusj3372PsJwKX39cHX/NpIHC\nHKE8qaGCpDqv0daH766eJ065dqO9DuorXPaPT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BuW73/9Sb5E+6auDoubCjC0cAIvs23MPju\nsMvKak4mQkI19foRXBydB/DDkK26iei/l0xoygrw50v2HErsQ7JcHw==\n-----END RSA PRIVATE KEY-----"
    }

响应消息

  • 响应参数
    表2 响应参数

    参数

    参数类型

    描述

    tenant_id

    String

    项目ID。

    id

    String

    证书ID。

    name

    String

    证书名称。

    description

    String

    描述。

    domain

    String

    服务端证书所签域名。

    certificate

    String

    证书内容。

    private_key

    String

    私钥。

    create_time

    String

    创建时间。

    update_time

    String

    更新时间。

  • 响应样例
    {
    "name":"cert-bky",
    "description":"certificate",
    "certificate":"-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJANoPUy2NktS6MA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwNjIyMDMyOTU5WhcNMTkwNjIyMDMyOTU5WjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEArmUUhzm5sxxVr/ku4+6cKqnKgZvDl+e/6CNCAq8YMZXTpJP64DjDPny9\n+8s9MbFabEG3HqjHSKh3b/Ew3FXr8LFa9YuWuAi3W9ii29sZsOwmzIfQhIOIaP1Y\nNR50DDjbAGTaxzRhV40ZKSOCkaUTvl3do5d8ttD1VlF2r0w0DfclrVcsS5v3kw88\n9gJ3s3hNkatfQiSt4qLNMehZ8Xofx58DIAOk/f3Vusj3372PsJwKX39cHX/NpIHC\nHKE8qaGCpDqv0daH766eJ065dqO9DuorXPaPT/nxw4PAccb9fByLrTams0ThvSlZ\no6V3yvHR4KN7mmvbViEmWRy+9oiJEwIDAQABo1AwTjAdBgNVHQ4EFgQUlXhcABza\n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RIVATE KEY-----",
    "tenant_id":"ed9edbc66b8b47c09f5d2fcd89430b33",
    "id":"5b8f908b5495452aa13beede0afc5d99",
    "create_time":"2016-06-27 08:14:42",
    "update_time":"2016-06-27 08:14:42"
    }

状态码

  • 正常

    201

  • 异常

    状态码

    编码

    错误码说明

    400

    badRequest

    请求错误

    401

    unauthorized

    鉴权失败

    403

    userDisabled

    没有权限

    404

    Not Found

    请求的页面不存在

    500

    authFault

    内部错误

    503

    serviceUnavailable

    服务不可用