更新时间:2024-09-27 GMT+08:00

修改Flexus L实例云主机信息

功能介绍

修改云主机信息,目前支持修改云主机名称及描述和hostname,所用接口为ECS的“修改云服务器”接口。本节列举了接口使用过程中的关键信息,接口更多信息详见修改云服务器

Flexus L实例中云主机所使用的该API接口与ECS相同,响应参数说明、接口使用示例、返回值等信息同样适用于Flexus L实例云主机。

接口约束

云主机hostname修改后,需要重启云主机后才会生效。

URI

PUT /v1/{project_id}/cloudservers/{server_id}

参数说明中server_id为云主机ID,请根据查询已创建的Flexus L实例获取云主机ID。

请求示例

将云主机ID为72a270de-665a-4f46-8d64-24ad6edccdd2的云主机hostname改为NameA。

PUT  /v1/{project_id}/cloudservers/{72a270de-665a-4f46-8d64-24ad6edccdd2}
{
 "server": {
  "hostname": "NameA"
 }
}

响应示例

{
 "server": {
  "tenant_id": "067cf8aecf3845d1ad7a5d308322f13b",
  "image": "",
  "accessIPv4": null,
  "metadata": {
   "__support_agent_list": "hss,hss-pc,ces"
  },
  "addresses": {
   "4022721e-0476-41ea-91f4-1883065a68cc": [
    {
     "addr": "192.168.12.151",
     "version": 4
    }
   ]
  },
  "security_options": {
   "secure_boot_enabled": null,
   "tpm_enabled": null
  },
  "accessIPv6": null,
  "created": "2024-09-13T07:30:25Z",
  "OS-EXT-SRV-ATTR:user_data": null,
  "hostId": "fc724a7f21982eec27a7c4d3ab33275733834e1d4316cadd2a684387",
  "description": "",
  "OS-EXT-SRV-ATTR:hostname": "NameA",
  "flavor": {
   "links": [
    {
     "rel": "bookmark",
     "href": "https://ecs.cn-north-4.myhuaweicloud.com/flavors/at7.large.1"
    }
   ],
   "id": "at7.large.1"
  },
  "OS-DCF:diskConfig": "MANUAL",
  "user_id": "862856742c334c8a801460a39f1f1cfb",
  "name": "hcss_ecs_ff60",
  "progress": 0,
  "links": [
   {
    "rel": "self",
    "href": "https://ecs.cn-north-4.myhuaweicloud.com/v1.0/servers/72a270de-665a-4f46-8d64-24ad6edccdd2"
   },
   {
    "rel": "bookmark",
    "href": "https://ecs.cn-north-4.myhuaweicloud.com/servers/72a270de-665a-4f46-8d64-24ad6edccdd2"
   }
  ],
  "id": "72a270de-665a-4f46-8d64-24ad6edccdd2",
  "updated": "2024-09-14T06:20:34Z",
  "status": "ACTIVE"
 }
}