Update data for an application server

You can use this operation to request that z/OSMF route an update data request to the application server where the server-side code for your plug-in resides.

HTTP method and URI path

POST /zosmf/externalgateway/system
PUT /zosmf/externalgateway/system
where:
  • zosmf/externalgateway identifies the application server routing services.
  • system informs the service that the request will be routed to only one application server.

Standard headers

Use the following standard HTTP header with this request:

Content-Type: application/json

Custom headers

None.

Request content

Your request must include a JSON object that describes the objects to be created or modified on the target application server. Table 1 lists the supported parameters.

Table 1. Supported input parameters for the application server routing services
Parameter Required Description
target Yes Nickname assigned to the system entry in the z/OSMF Systems task that describes the settings required to access the application server where the server-side code for your plug-in resides. If the specified system entry does not exist, the request will fail.
z/OSMF stores the nickname for the target application server in the window object in the Browser Object Model. To retrieve the nickname, issue the following JavaScript command from your task:
window.frameElement.getAttribute("target") 
For example:
postCreate: function() {
  var target = window.frameElement.getAttribute("target");
  var remoteURL = "/zosmf/externalgateway/system?content=
    {'target':'" + target + "','resourcePath':'/testApp'}";
}  
resourcePath Yes Path to the service that will process the request.
requestProperties No HTTP headers to be included in the HTTP request. Specify the HTTP headers as name and value pairs. If HTTP headers are omitted or are null, default values will be used, which are valid for most installations.
timeout No Amount of time in milliseconds allowed to process a request. The value can range from 1 to 5601000 milliseconds. If omitted, the default value of 20000 milliseconds is used.
wrapped No Indicator of whether the application server routing service will wrap the response from the target application server in a JSON object that contains additional information about the response. Set the parameter to N to obtain only the response provided by the target application server. Otherwise, set the parameter to Y or omit it to obtain the response along with additional information. For more details, see Content type used for HTTP response data.
binary No Indicator of whether the response from the target application server is in binary format. Set the parameter to N or omit it if the response is not in binary format. Otherwise, set the parameter to Y if the response is in binary format.
content Yes if the HTTP method is POST or PUT. Parameters or JSON object to include in the body of the HTTPS request that will be sent to the service that will process the request.

Required authorizations

See Application server routing services.

Expected response

On completion, the service returns an HTTP response, which includes a status code indicating whether your request completed. Status code 200 indicates success. A status code of 4nn or 5nn indicates that an error has occurred. For more details, see Error handling.

The response also includes a JSON object that contains the requested information. For more details, see Content type used for HTTP response data.

Example

To add objectC on the application server identified in system entry appServer1, which is defined in the z/OSMF Systems task, submit the following request:
Figure 1. Sample request to update data on an application server
POST /zosmf/externalgateway/system HTTP/1.1

Host: appname.yourco.com

{"target":"appServer1","resourcePath":"/testApp/objectC","content":{
"attribute1":"value11","attribute2":"value12","attribute3":"value13",
"attribute4":"value14","attribute5":"value15"}}
A sample response is shown in Figure 2.
Figure 2. Sample response for updating data on an application server
HTTP/1.1 200 OK
Date: Tue, 28 Apr 2015 05:39:28 +0000GMT
Connection: close

{
  "primaryAPIVersion":1.0,
  "systemsOutput":
    {
      "systemOutput":
        {
          "result":"success"
        },
      "rc":"Ok",
      "error":null,
	    "systemName":"appServer1"
    },
  "numOfSystems":1
}