Retrieve data from an application server

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

HTTP method and URI path

GET /zosmf/externalgateway/system?content=<http-content>
where:
  • zosmf/externalgateway identifies the application server routing services.
  • system informs the service that the request will be routed to only one application server.
  • content=<http-content> represents the parameters used to qualify the request. Table 1 lists the parameters that are supported for this request.
    Important: If the value for a parameter contains a number sign (#), encode the number sign as %23. Otherwise, everything following the number sign will be omitted from the request. For example, if the target is AppServer#1, specify AppServer%231.
    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.

Standard headers

Use the following standard HTTP header with this request:

Content-Type: application/json

Custom headers

None.

Request content

None.

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 1: Retrieve wrapped data from an application server

To retrieve wrapped data from 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 retrieve wrapped data from an application server
GET /zosmf/externalgateway/system?content={"target":"appServer1","resourcePath":"/testApp"} HTTP/1.1

Host: appname.yourco.com
A sample response is shown in Figure 2.
Figure 2. Sample response for retrieving wrapped data from an application server
HTTP/1.1 200 OK
Date: Tue, 28 Apr 2015 05:39:28 +0000GMT
Connection: close

{
  "primaryAPIVersion":1.0,
  "systemsOutput":
    {
      "systemOutput":
        {
          "items":[
            {
              "object-ID":"objectA"
              "attribute1":"value1",
              "attribute2":"value2",
              "attribute3":"value3",
              "attribute4":"value4",
              "attribute5":"value5",
            },
            {
              "object-ID":"objectB"
              "attribute1":"value6",
              "attribute2":"value7",
              "attribute3":"value8",
              "attribute4":"value9",
              "attribute5":"value10",
            }
          ],
        },
      "rc":"Ok",
      "error":null,
	    "systemName":"appServer1"
    },
  "numOfSystems":1
}

Example 2: Retrieve unwrapped data from an application server

To retrieve unwrapped data from the application server identified in system entry appServer1, which is defined in the z/OSMF Systems task, submit the following request:
Figure 3. Sample request to retrieve unwrapped data from an application server
GET /zosmf/externalgateway/system?content={"target":"appServer1","resourcePath":"/testApp",
"wrapped":"N"} HTTP/1.1

Host: appname.yourco.com
A sample response is shown in Figure 4.
Figure 4. Sample response for retrieving unwrapped data from an application server
HTTP/1.1 200 OK
Date: Tue, 28 Apr 2015 05:39:28 +0000GMT
Connection: close


{
  "items":[
  {
    "object-ID":"objectA"
    "attribute1":"value1",
    "attribute2":"value2",
    "attribute3":"value3",
    "attribute4":"value4",
    "attribute5":"value5",
  },
  {
    "object-ID":"objectB"
    "attribute1":"value6",
    "attribute2":"value7",
    "attribute3":"value8",
    "attribute4":"value9",
    "attribute5":"value10",
  }]
}

Example 3: Retrieve binary data from an application server

To retrieve binary data from the application server identified in system entry appServer1, which is defined in the z/OSMF Systems task, submit the following request:
Figure 5. Sample request to retrieve binary data from an application server
GET /zosmf/externalgateway/system?content={"target":"appServer1","resourcePath":"/testApp",
"binary":"Y"} HTTP/1.1

Host: appname.yourco.com
A sample response is shown in Figure 6.
Figure 6. Sample response for retrieving binary data from an application server
HTTP/1.1 200 OK
Date: Tue, 28 Apr 2015 05:39:28 +0000GMT
Connection: close


01111011 00001101 00001010 00100000 00100000 00100010 01101001 01110100 01100101 01101101 
01110011 00100010 00111010 01011011 00001101 00001010 00100000 00100000 01111011 00001101 
00001010 00100000 00100000 00100000 00100000 00100010 01101111 01100010 01101010 01100101 
01100011 01110100 00101101 01001001 01000100 00100010 00111010 00100010 01101111 01100010 
01101010 01100101 01100011 01110100 01000001 00100010 00001101 00001010 00100000 00100000 
00100000 00100000 00100010 01100001 01110100 01110100 01110010 01101001 01100010 01110101 
01110100 01100101 00110001 00100010 00111010 00100010 01110110 01100001 01101100 01110101 
01100101 00110001 00100010 00101100 00001101 00001010 00100000 00100000 00100000 00100000 
00100010 01100001 01110100 01110100 01110010 01101001 01100010 01110101 01110100 01100101 
00110010 00100010 00111010 00100010 01110110 01100001 01101100 01110101 01100101 00110010 
00100010 00101100 00001101 00001010 00100000 00100000 00100000 00100000 00100010 01100001 
01110100 01110100 01110010 01101001 01100010 01110101 01110100 01100101 00110011 00100010 
00111010 00100010 01110110 01100001 01101100 01110101 01100101 00110011 00100010 00101100 
00001101 00001010 00100000 00100000 00100000 00100000 00100010 01100001 01110100 01110100 
01110010 01101001 01100010 01110101 01110100 01100101 00110100 00100010 00111010 00100010 
01110110 01100001 01101100 01110101 01100101 00110100 00100010 00101100 00001101 00001010 
00100000 00100000 00100000 00100000 00100010 01100001 01110100 01110100 01110010 01101001 
01100010 01110101 01110100 01100101 00110101 00100010 00111010 00100010 01110110 01100001 
01101100 01110101 01100101 00110101 00100010 00101100 00001101 00001010 00100000 00100000 
01111101 00101100 00001101 00001010 00100000 00100000 01111011 00001101 00001010 00100000 
00100000 00100000 00100000 00100010 01101111 01100010 01101010 01100101 01100011 01110100 
00101101 01001001 01000100 00100010 00111010 00100010 01101111 01100010 01101010 01100101 
01100011 01110100 01000010 00100010 00001101 00001010 00100000 00100000 00100000 00100000 
00100010 01100001 01110100 01110100 01110010 01101001 01100010 01110101 01110100 01100101 
00110001 00100010 00111010 00100010 01110110 01100001 01101100 01110101 01100101 00110110 
00100010 00101100 00001101 00001010 00100000 00100000 00100000 00100000 00100010 01100001 
01110100 01110100 01110010 01101001 01100010 01110101 01110100 01100101 00110010 00100010 
00111010 00100010 01110110 01100001 01101100 01110101 01100101 00110111 00100010 00101100 
00001101 00001010 00100000 00100000 00100000 00100000 00100010 01100001 01110100 01110100 
01110010 01101001 01100010 01110101 01110100 01100101 00110011 00100010 00111010 00100010 
01110110 01100001 01101100 01110101 01100101 00111000 00100010 00101100 00001101 00001010 
00100000 00100000 00100000 00100000 00100010 01100001 01110100 01110100 01110010 01101001 
01100010 01110101 01110100 01100101 00110100 00100010 00111010 00100010 01110110 01100001 
01101100 01110101 01100101 00111001 00100010 00101100 00001101 00001010 00100000 00100000 
00100000 00100000 00100010 01100001 01110100 01110100 01110010 01101001 01100010 01110101 
01110100 01100101 00110101 00100010 00111010 00100010 01110110 01100001 01101100 01110101 
01100101 00110001 00110000 00100010 00101100 00001101 00001010 00100000 00100000 01111101 
01011101 00001101 00001010 01111101