Web API Reference Guide > Available API Methods > Virtual Hosts Methods > The vhostRemove Method

The vhostRemove Method

Remove the list of virtual hosts currently used by the web server and information about each virtual host. Names will be mandatory parameter, otherwise the error will be return.

Version: 1.6

Required Permissions: Read-only

HTTP method: POST

Supported by Editions: Zend Server

Request Parameters:

Parameter

 Type

Required

Description

vhosts

Array

Yes

List of virtual hosts IDs to be removed.

Expected Response Code: 200 OK  - For more information see Response Format.

Response Type: vhostList

Possible Action Specific Error Codes:

HTTP Code

 Error Code

Description

404

noSuchVhost

Required virtual host ID was not found.

406

vhostIsNotManaged

The requested virtual host is not managed by Zend Server and cannot be redeployed.

406

virtualHostHasDependents

This virtual host has applications that depend on it, and therefore cannot be removed.

Example

Usage Example

Request

POST /ZendServerManager/Api/vhostRemove vhosts[]=1&vhosts[]=2

Response

<?xml version="1.0" encoding="UTF-8"?>

<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.6">

<requestData>

<apiKeyName>angel.eyes</apiKeyName>

<method>vhostRemove</method>

</requestData>

<responseData>

<vhostList>

<vhostInfo>

<id>1</id>

<name>foo</name>

<port>80</port>

<status>Ok</status>

<default>true</default>

<zendDefined>true</zendDefined>

<zendManaged>true</zendManaged>

<ssl>false</ssl>

<created>1970-01-01T02:00:00+02:00</created>

<lastUpdated>1970-01-01T02:00:00+02:00</lastUpdated>

<createdTimestamp>1367237856</createdimestamp>

<lastUpdatedTimestamp>1367237856</lastUpdatedTimestamp>

<servers>

<vhostServer>

<id>1</id>

<status>Ok</status>

<lastMessage><![CDATA[]]></lastMessage>

</vhostServer>

...

</servers>

</vhostInfo>

...

</vhostList>

</responseData>

</zendServerAPIResponse>

 

Read Also

  Available API Methods    
  Virtual Hosts Methods