Web API Reference Guide > Available API Methods > Deployment Methods > The applicationDefine Method

Then applicationDefine Method

Define application to the server or cluster. This process is asynchronous – the initial request will wait until the application is defined, and the initial response will show information about the application being defined – however the staging and activation process will proceed after the response is returned. The user is expected to continue checking the application status using the applicationGetStatus method until the deployment process is complete.

Version: 1.3

Required Permissions: Full

HTTP method: POST

Supported by Editions: All

Request Parameters:

Parameter

 Type

Required

Description

name

File

Yes

Application name.

baseUrl

String

Yes

Base URL to define the application to. Must be an HTTP URL. use <default-server> if needed.

version

String

No

The version of the application.

healthCheck

String

No

The health check url.

logo

File

No

Logo image file.

Expected Response Code: 202 OK. For more information see Response Format.

Response Type: applicationInfo

Possible Action Specific Error Codes:

HTTP Code

 Error Code

Description

409

baseUrlConflict

Provided base URL is already in use.

400

missingParameter

A required parameter is missing.

400

invalidParameter

A value provided for a parameter is invalid.

Example

Usage Example

Request(some headers removed for clarity)

POST /ZendServerManager/Api/applicationDefine

Content-type: multipart/form-data, boundary=--bla-bla-bla--

----bla-bla-bla--

Content-disposition: form-data; name=baseUrl

http://example.com/

----bla-bla-bla--

Content-disposition: form-data; name=”appPackage”;

logo=”logo.jpg”

[...binary data follows...]

Content-disposition: form-data; name=version=”1.0”

Content-disposition: form-data; name=healthCheck=””

database_schema

----bla-bla-bla----

----bla-bla-bla--

Response

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

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

<requestData>

<apiKeyName>angel.eyes</apiKeyName>

<method>applicationDefine</method>

</requestData>

<responseData>

<applicationInfo>

<id>2</id>

<baseUrl>http://oapp.example.com:8080/</baseUrl>

<appName>Blog 2.0</appName>

<userAppName>Wolfgang's Blog</userAppName>

<installedLocation>/usr/local/somewhere</installedLocation>

<status>staging</status>

<servers>

<applicationServer>

<id>1</id>

<deployedVersion>1.0</deployedVersion>

<status>staging</status>

</applicationServer>

</servers>

<deployedVersions>

<deployedVersion>1.0</deployedVersion>

</deployedVersions>

<messageList />

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

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

<isDefinedApplication>true</isDefinedApplication>

</applicationInfo>

</responseData>

</zendServerAPIResponse>

 

Read Also

  Available API Methods    
  Deployment Methods