Backend Service Configuration for API Connector (POST)

Deploys backend service configuration for API Connector.

Description

Deploys backend service configuration for API Connector.

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, 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

Method

POST

Path

/management-apis/2.0/runtimes/runtime-name/backend-services-config

Example

https://www.example.com/mfpadmin/managementapis/2.0/runtimes/mfp/backend-services-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.

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

Android


  {
    "backendServices" : [
    	{
            "service": "resorts",
            "baseUrl":"http://resorts.mybluemix.net/resorts/",
            "auth" : {
                "type" : "basic",
                "credential" : {
                    "username" : "hello",
                    "password" : "hello"
                }
            }
        },
        {
            "service": "tone-analyzer",
            "baseUrl":"https://api.us-south.tone-analyzer.watson.cloud.ibm.com/instances/0b83e9c5-18e5-4aeb-9cfd-65f9007e950e",
            "auth": {
                "type" : "apikey",
                "credential" : {
                    "apikey" : "",
                    "policy" : "basic",
                    "name" : "apikey"
                }
            },
            "ConnectionProperties" : {
                "maxConnetions" : "50",
                "connectionTimeoutInMilliseconds" : "30000",
                "socketTimeoutInMilliseconds" : "30000"
            }
        },
        {
            "service": "reference",
            "baseUrl":"http://web-bluecompute.apps.mfstorefront.os.fyre.ibm.com/",
            "auth" : {
                "type" : "extauth"
            },
            "ConnectionProperties" : {
            	"maxConnetions" : "50",
                "connectionTimeoutInMilliseconds" : "3000",
                "socketTimeoutInMilliseconds" : "3000"
        	}
        },
        {
            "service": "fb",
            "baseUrl":"http://localhost:9090/SocialLogin/",
            "auth" : {
                "type" : "mfpauth"
            },
            "ConnectionProperties" : {
                "maxConnetions" : "50",
                "connectionTimeoutInMilliseconds" : "3000",
                "socketTimeoutInMilliseconds" : "3000"
            }
        }

    ]
}

Payload Properties

The payload has the following properties:
service
The logical name of the service that is used by the client app to call methods exposed by service whose url is provided by baseUrl.
baseUrl
The context url of the backend service. The request from client on the service is passed to the service defined by the baseUrl.
auth
Authentication types to connect to backend service.
auth.type
Authentication types, can have values such as basic, apikey, mfpauth and extauth.
auth.credential
The credentials for authentication types such as basic and apikey, other types do not require credentials. The policy for apikey can be header, query and basic based on how the backend service is protected.
connectionProperties
Optional. The various connection properties while Mobile Foundation server connects to backend service.
connectionProperties.maxConnetions
Defines the maximum number of concurrent connections, which the Mobile Foundation Server can open to the backend service.
connectionProperties.connectionTimeoutInMilliseconds
The timeout in milliseconds until a connection to the back-end can be established.
connectionProperties.socketTimeoutInMilliseconds
The timeout in milliseconds between two consecutive packets, starting from the connection packet.

Response

The metadata of the deployable.

JSON Example

{
  "transaction": {
      "id": 126,
      "type": "UPLOAD_ARTIFACT",
      "status": "SUCCESS",
      "project": {
          "name": "mfp"
      },
      "timeCreated": "2020-07-10T05:29:45.017Z",
      "timeUpdated": "2020-07-10T05:29:45.293Z",
      "userName": "admin",
      "appServerId": "Liberty",
      "errors": [],
      "warnings": [],
      "description": {
          "name": "mfp.configService.singletonDeployable",
          "type": "BACKEND_SERVICE_CONFIG"
      }
  },
  "ok": true,
  "productVersion": "8.0.0.00-20200618-035754"
}

Errors

400
The Payload is invalid.
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.