The applicationAttachVhosts Web API Method

Attaches virtual hosts to the app identified by appId. The virtual hosts are identified by the vhostsIds that are passed in the vhosts[] array. Restarts the web server after the configuration has been updated in the file system. Only the configuration of the vhost that is to be attached is modified. Active symlinks are not modified. The method returns true on success.

Version: 1.15

Required Permissions: Read-only

HTTP method: POST

Supported by Editions: Zend Server

Request Parameters:

Parameter

 Type

Required

Description

appId

Integer

Yes

The ID of the application to which you want to attach the vhost.

vhosts

Array

Yes

Array of Id(s) of the vhosts to be attached.

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

Response Type: applicationsDetails

Possible Action Specific Error Codes: This action has no specific error codes

Example

Usage Example

Request

POST /ZendServer/Api/applicationAttachVhosts?appId=1&vhosts[]=3&vhosts[]=4

Response

{result : true}

 

Important Note:

For Zend Serveron Linux, this action is also available via the command line using CLI Tools. For more information see CLI Tools.