云搜索服务 CSS-快速入门:具体步骤

时间:2023-11-01 16:20:40

具体步骤

  1. 获取Token ,发送“POST https:// IAM 的Endpoint/v3/auth/tokens”。

    Token认证,具体操作请参考认证鉴权

    在响应Header中获取“X-Subject-Token”的值即为用户Token。

  2. 设置请求消息头,在Request Header中增加“Content-type ”和“X-Auth-Token”。
    • Content-Type:消息体的类型(格式),默认取值为“application/json”
    • X-Auth-Token:填写1获取的用户Token。
  3. 发送创建集群的请求,在Request Body中传入参数如下:
    POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters{     "cluster": {         "name": "ES-Test",        "backupStrategy": {            "period": "16:00 GMT+08:00",            "prefix": "snapshot",            "keepday": 7        },        "instanceNum": 3,           "instance": {                "flavorRef": "ess.spec-2u16g",                   "volume": {                          "volume_type": "COMMON",                          "size": 100                  },                   "nics": {                          "vpcId": "fccd753c-91c3-40e2-852f-5ddf76d1a1b2",                         "netId": "af1c65ae-c494-4e24-acd8-81d6b355c9f1",                          "securityGroupId": "7e3fed21-1a44-4101-ab29-34e57124f614"                   }           }    } }
    响应消息样例。
    {  "cluster": {    "id": "ef683016-871e-48bc-bf93-74a29d60d214",    "name": "ES-Test"  }}

    请求响应成功后,返回200 OK,表示集群创建成功。

    若请求失败,则会返回错误码及对应的错误信息说明,详细错误码信息请参考状态码

support.huaweicloud.com/api-css/css_03_0062.html