For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Application (POST)

Deploys an application.


Description

A deployable application

It first checks whether the input deployable is valid. Then, it transfers the deployable to the database and to the runtime.

This transaction can run synchronously or asynchronously. If processed asynchronously, the REST service returns before the transaction is completed. In this case, we can query the transaction result later by using the transaction REST service.


Roles

Users in the following roles are authorized to perform this operation:


Method

POST


Path

/management-apis/2.0/runtimes/runtime-name/applications


Example

https://www.example.com/mfpadmin/management-apis/2.0/runtimes/myruntime/applications?async=false&locale=de_DE


Path Parameters

runtime-name
The name of the runtime. This is the context root of the runtime web application, without the leading slash.


Query Parameters

Query parameters are optional.

async
Whether the transaction is processed synchronously or asynchronously. The allowed values are true and false. By default, transactions are processed in synchronous mode.
locale
The locale used for error messages.


Consumes

application/json


Produces

application/json, application/xml, text/xml


Payload


JSON Example

{ "applicationKey" : { "bundleId" : "com.example", "clientPlatform" : "B2C", "version" : "com.package.id", }, "displayName" : "Display Name", "mandatoryScope" : "appAuthenticity", "scopeTokenMapping" : { "get-enroll-state" : "", "set-enroll-state" : "usernamePassword", }, "securityCheckConfigurations" : { "appAuthenticity" : { "expirationSec" : "1200", }, }, "usernamePassword" : { "inactivityTimeoutSec" : 30, "maxAttempts" : 3, }, }


Payload Properties

The payload has the following properties:
applicationKey
application key
displayName
Display Name
mandatoryScope
scope
scopeTokenMapping
scope token mapping
securityCheckConfigurations
security check configuration
usernamePassword
username password

The applicationKey has the following properties:

bundleId
this is for iOS. Note: For Android, use packageName. For Windows, use assemblyName.
clientPlatform
License category
version
version

The scopeTokenMapping has the following properties:

get-enroll-state
get enroll state
set-enroll-state
set-enroll-state

The securityCheckConfigurations has the following properties:

appAuthenticity
app auth configurations

The expirationSec has the following properties:

expirationSec
expiration in sec

The usernamePassword has the following properties:

inactivityTimeoutSec
inactive time out
maxAttempts
maximum attemts


Response

The metadata of the deployable.


JSON Example

{ "ok" : false, "productVersion" : "8.0", "transaction" : { "appServerId" : "Tomcat", "description" : { "name" : "myname", "type" : "mytype", }, "errors" : [ { "details" : "An internal error occured.", }, ... ], "id" : 1, "project" : { "name" : "myproject", }, "status" : "FAILURE", "timeCreated" : "2014-04-13T00:18:36.979Z", "timeUpdated" : "2014-04-14T00:18:36.979Z", "type" : "UPLOAD_ARTIFACT", "userName" : "demouser", }, }


XML Example

<?xml version="1.0" encoding="UTF-8"?> <deploy-application-result ok="false" productVersion="8.0"> <transaction appServerId="Tomcat" id="1" status="FAILURE" timeCreated="2014-04-13T00:18:36.979Z" timeUpdated="2014-04-14T00:18:36.979Z" type="UPLOAD_ARTIFACT" userName="demouser"> <description name="myname" type="mytype"/> <errors> <error details="An internal error occured."/> ... </errors> <project name="myproject"/> </transaction> </deploy-application-result>


Response Properties

The response has the following properties:

ok
Whether the transaction was successful.
productVersion
The exact product version.
transaction
The details of the transaction.

The transaction has the following properties:

appServerId
The id of the web application server.
description
The details of the deployable.
errors
The errors occurred during the transaction.
id
The id of the transaction.
project
The current project.
status
The state of the transaction: PENDING, PREPARING, COMMITTING, REJECTING, SUCCESS, FAILURE, CANCELED. Synchronous transactions can have the state SUCCESS and FAILURE. Asynchronous transactions can also have the other states.
timeCreated
The date in ISO 8601 format when the adapter was created.
timeUpdated
The date in ISO 8601 format when the adapter was updated.
type
The type of the transaction, here always UPLOAD_ARTIFACT.
userName
The user that initiated the transaction.

The description has the following properties:

contentNames
The optional names of the contained artifacts if multiple artifacts were deployed at once.
filename
The optional file name of the artifact.
name
The name of the artifact.
type
The type of the artifact.

The error has the following properties:

details
The main error message.

The project has the following properties:

name
The name of the project, which is the context root of the runtime.


Errors

400

No deployable data is provided. 403

The user is not authorized to call this service. 404

The corresponding runtime is not found or not running. 500

An internal error occurred.

Parent topic: REST API for the MobileFirst Server administration service