Application Configuration (PUT)

Sets the configuration of a specific application version.

Description

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

Roles

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

  • mfpadmin
  • mfpdeployer
  • mfpoperator

Method

PUT

Path

/management-apis/2.0/runtimes/runtime-name/applications/application-name/application-env/application-version/config

Example

https://www.example.com/mfpadmin/management-apis/2.0/runtimes/myruntime/applications/myapplication/android/1.0/config?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.
application-name
The name of the application.
application-env
The application environment.
application-version
The application version number.

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, application/xml, text/xml

Produces

application/json, application/xml, text/xml

Payload

JSON Example - BLOCK action

{
  {
   "applicationAccessConfig":{
      "action":"BLOCK",
      "message":"The application is blocked.",
      "downloadLink":"www.ynet.co.il",
      "multiLanguageMessages":[
         "locale" : "de",
        "message" : "Bitte updaten!"
      ]
   },
   "clientLogProfiles":[
      {
         "level":"INFO",
         "name":"com.acme.sub1"
      }
   ]
}

JSON Example - NOTIFY action

{
  {
   "applicationAccessConfig":{
      "action":"NOTIFY",
      "message":"The application is notified.",
      "multiLanguageMessages":[
         "locale" : "de",
        "message" : "Bitte updaten!"
      ]
   },
   "clientLogProfiles":[
      {
         "level":"INFO",
         "name":"com.acme.sub1"
      }
   ]
}

JSON Example - ACTIVE action

{
  {
   {
   "applicationAccessConfig":{
      "action":"ACTIVE"
   },
   "clientLogProfiles":[
      {
         "level":"INFO",
         "name":"com.acme.sub1"
      }
   ]
}

XML Example - BLOCK action

<?xml version="1.0" encoding="UTF-8"?>
<appconfig>
  <applicationAccessConfig
    action="BLOCK"
    downloadLink="www.ynet.co.il"
    message="The application is blocked.">
    <multiLanguageMessages>
      <multiLanguageMessage
        locale="de"
        message="Bitte updaten!"/>
    </multiLanguageMessages>
  </applicationAccessConfig>
  <clientLogProfiles
    level="INFO"
    name="com.acme.sub1"/>
</appconfig>

XML Example - NOTIFY action

<?xml version="1.0" encoding="UTF-8"?>
<appconfig>
  <applicationAccessConfig
    action="NOTIFY"
    message="The application is blocked.">
    <multiLanguageMessages>
      <multiLanguageMessage
        locale="de"
        message="Bitte updaten!"/>
    </multiLanguageMessages>
  </applicationAccessConfig>
  <clientLogProfiles
    level="INFO"
    name="com.acme.sub1"/>
</appconfig>

XML Example - ACTIVE action

<?xml version="1.0" encoding="UTF-8"?>
<appconfig>
  <applicationAccessConfig
    action="ACTIVE">
  </applicationAccessConfig>
  <clientLogProfiles
    level="INFO"
    name="com.acme.sub1"/>
</appconfig>

Payload Properties

The payload has the following properties:
applicationAccessConfig
The access configuration of an application version.
clientLogProfiles
The log filters to collect application logs from devices according to a profile.

The accessConfig has the following properties:

action
Application access status. The values for the action property are `BLOCK`, `NOTIFY` or `ACTIVE`
downloadLink
The URL for the new version of the application to download.
message
The message that the user receives when opening the application.
multiLanguageMessages
The notification text in differenet languages.

The languages has the following properties:

locale
The locale for the language
message
The message in the locale

The logfilters has the following properties:

level
The severity level. Errors are returned from this level upwards.
name
The logical package name that is used to identify the logger in the mobile application

Response

The configuration of the specified application version.

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" : "SET_APPLICATION_ENV_VERSION_ACCESS_RULE",
    "userName" : "demouser",
  },
}

XML Example

<?xml version="1.0" encoding="UTF-8"?>
<set-appconfig-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="SET_APPLICATION_ENV_VERSION_ACCESS_RULE"
    userName="demouser">
    <description
      name="myname"
      type="mytype"/>
    <errors>
      <error details="An internal error occured."/>
      ...
    </errors>
    <project name="myproject"/>
  </transaction>
</set-appconfig-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 application.
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 SET_APPLICATION_ENV_VERSION_ACCESS_RULE.
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
The payload is invalid.
403
The user is not authorized to call this service.
404
The corresponding runtime or the app version is not found.
500
An internal error occurred.