The vhostEdit Web API Method

Edit an existing vhost. Receives vhostId and template and returns a single virtual host element with the same information.

Version: 1.6

Required Permissions: Read-only

HTTP method: POST

Supported by Editions: Zend Server

Request Parameters:

Parameter

 Type

Required

Description

vhostId

Integer

Yes

virtual host ID.

template

String

Yes

New vhost template of virtual host settings.

forceCreate

Boolean

No

Force edit of the virtual host template even if any errors are detected.

sslCertificatePath

String

No

File path to locate the SSL certificate file

sslCertificateKeyPath

String

No

File path to locate the SSL key file

sslCertificateChainPath

String

No

File path to locate the SSL chain file

sslAppName

String

No

Application name for SSL (IBMI only)

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

Response Type: vhost

Possible Action Specific Error Codes:

HTTP Code

 Error Code

Description

404

noSuchVhost

Required virtual host ID was not found.

406

serverConfigurationError

The template provided as virtual host configuration has failed syntax or staging checks. A detailed message will appear to explain the failure.

Example

Usage Example

Request

POST /ZendServer/Api/vhostEdit
vhostId=5&template=xxx...

Response

<?xml version="1.0" encoding="UTF-8"?>
<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.6">
	<requestData>
		<apiKeyName>angel.eyes</apiKeyName>
		<method>vhostEdit</method>
	</requestData>
	<responseData>
		<vhostList>
			<vhostInfo>
				<id>1</id>
				<name>foo</name>
				<port>80</port>
				<fullName>foo:80</fullName>
				<status>Adding</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>