Creates a vhost.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateVirtualHost

The operation that you want to perform.

Set the value to CreateVirtualHost.

InstanceId String Yes 1880770869023***

The ID of the instance.

RegionId String Yes cn-hangzhou

The ID of the region.

VirtualHost String Yes Demo

The name of the vhost. Description:

  • The vhost name can contain only letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
  • The vhost name must be 1 to 255 characters in length.
  • After the vhost is created, you cannot modify its name. If you want to modify its name, delete the vhost and create a new vhost.

Response parameters

Parameter Type Example Description
RequestId String 628705FD-03EE-4ABE-BB21-E1672960***

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateVirtualHost
&InstanceId=1880770869023***
&RegionId=cn-hangzhou
&VirtualHost=Demo
&<Common request parameters>

Sample success responses

XML format

<CreateVirtualHostResponse>
      <RequestId>628705FD-03EE-4ABE-BB21-E1672960***</RequestId>
</CreateVirtualHostResponse>

JSON format

{
    "RequestId": "628705FD-03EE-4ABE-BB21-E1672960***"
}

Error codes

For a list of error codes, visit the API Error Center.