删除云主机Hostname(DeleteVmHostname)

删除云主机的Hostname。
Note: 该删除操作仅仅是删除配置在数据库中以及DHCP服务器上的云主机hostname,无法改变云主机内部手动配置的hostname。

API请求

URLs
DELETE zstack/v1/vm-instances/{uuid}/hostnames?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json" \
-H "Authorization: OAuth efe37b8868b54c6c93b9f83a04ffe27c" \
-X DELETE http://localhost:8080/zstack/v1/vm-instances/\
55fefc89f98b49f99e96bb01765d42ed/hostnames?deleteMode=Permissive
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 云主机UUID 0.6
deleteMode(可选) String body 0.6
systemTags (可选) List body 系统标签 0.6
userTags (可选) List body 用户标签 0.6

API返回

该API成功时返回一个空的JSON结构{},出错时返回的JSON结构包含一个error字段,例如:
{
    "error": {
        "code": "SYS.1001",
        "description": "A message or a operation timeout",
        "details": "Create VM on KVM timeout after 300s"
    }
}

SDK示例

Java SDK
DeleteVmHostnameAction action = new DeleteVmHostnameAction();
action.uuid = "ab14af23812445e891695e0c9ef7b635";
action.deleteMode = "Permissive";
action.sessionId = "25d8bc148fcb4061b0aa340d1e4c68a8";
DeleteVmHostnameAction.Result res = action.call();

Python SDK

DeleteVmHostnameAction action = DeleteVmHostnameAction()
action.uuid = "0f4ad3768b1e4e8bb1ec33646a3067de"
action.deleteMode = "Permissive"
action.sessionId = "fb18f70b6fc24b5f955817aaabbae4cc"
DeleteVmHostnameAction.Result res = action.call()