Space banner

   

This space provides the same content as before, but the organization of the home page has changed. The content is now organized based on logical branches instead of legacy book titles. We hope that the new structure will help you quickly find the content that you need.

Retrieving MainView data using the Common REST API

You can use the BMC Common REST API to retrieve MainView view definitions and Mainview data:

Before you begin

You must have the Common REST API installed and running. For more information, see Setting up the Common REST API.

You have two endpoints for retrieving data from a MainView view:

Retrieving a view definition using the GetView endpoint

The GetView endpoint uses the POST method to retrieve a MainView view definition. To retrieve the view definition for a MainView view, use a URL based on the following structure:

https://<hostName>:<portNnumber>/cra/ServiceGateway/Services/<serviceName>/getView?product=<productName>&view=<viewName>

The variables represent the following values:

  • <hostName> is the name of the mainframe host where the Tomcat server is running.
  • <portNumber> is the port number of the Tomcat server.
  • <serviceName> is the name of the service as it appears on the list. For more information, see To retrieve a list of services.

Set the following parameters:

Note

If accepting the default value for a parameter, you can omit that parameter from the URL. However, parameters that do not have default values are required.


ParameterDescription
context

Context of the server from which you want to retrieve data

Default: *

product

( required ) Product from which you want to retrieve data

Example: MVMVS

server

Server from which you want to retrieve data

Default: *

system

System from which you want to retrieve data

Default : *

scope

Scope for which you want to retrieve data

Default: *

view

(required) View for which you want to retrieve data

Example: JCPU

  1. Set the Authorization header type to Basic Auth. Set Username and Password to your mainframe user credentials for accessing Tomcat. This user must have the required SAF permission defined.
  2. In the Header, set the Content-Type to application/x-www-form-urlencoded
  3. In the Body, set the following key:
          userToken=<userToken>
    <userToken> is the token issued to you when you logged on. For more information, see Logging in to a service using the Common REST API

In curl, the command would look something like the following example:

Example
curl -u username:password -d "userToken=38651614-99ca-4ec8-90ce-334475abc0f4" https://mymainframe:161616/cra/ServiceGateway/Services/MVA/getView?product=MVMVS&view=JCPU



Retrieving view data using the GetData endpoint

The GetData endpoint uses the POST method to retrieve data from a MainView view. To retrieve data from a MainView view, use a URL based on the following structure:

  https://<hostName>:<portNumber>/cra/ServiceGateway/Services/<servicename>/getData?product=<productname>&select=<select_statement>

The variables represent the following values:

  • <hostName> is the name of the Mainframe host where the Tomcat server is running.
  • <portNumber> is the port number of the Tomcat server.

Set the following parameters:

Note

If accepting the default value for a parameter, you can omit that parameter from the URL. However, parameters that do not have default values are required.


ParameterDescription
context

Context of the server from which you want to retrieve data

Default: *

product( required ) Product from which you want to retrieve data
server

Server from which you want to retrieve data

Default: *

system

System from which you want to retrieve data

Default: *

scope

Scope for which you want to retrieve data

Default: *

select

(required) Selection criteria for for your data request

Examples of select strings:

  • View name
  • WHERE clause
  • QWHERE clause

Notes

  • Replace any ampersand (&) characters in your command strings with AND.
  • All text in the select parameter must be in uppercase.
period

Timestamp of the data to be retrieved

Possible values are:

  • * is the current time.
  • = is the Same time period as the previous request.
  • yyyy/mm/dd hh:mm:ss nh is n hours from timestamp.
  • yyyy/mm/dd hh:mm:ss nm is n minutes from timestamp.
  • yyyy/mm/dd hh:mm:ss ni is n intervals from timestamp.                  

Default: =

startrow

Row from which to start the data retrieval

Default: 1

rows

Number of rows to retrieve

Default: 200

Maximum: 999999

refresh

Whether to refresh the data for the request

Possible values are:

Y – Refresh the view data.  BMC recommends using this option for the initial GetData request.  

N – For subsequent requests, to get the same set view data as the previous request. For example, use N to get more rows of data from the same view.

Default: Y

session

(optional) Session token for retrieving more data for the same view as a previous GetData request

For more information, see Managing Common REST API session tokens and user tokens.

  1. Set the Authorization header type to Basic Auth. Set Username and Password to your mainframe user credentials for accessing Tomcat. This user must have the required SAF permission defined.
  2. In the Header, set the Content-Type to application/x-www-form-urlencoded
  3. In the Body, set the following key: 
          userToken=<userToken
    <userToken> is the token issued to you when you logged on. For more information, see Logging in to a service using the Common REST API

In curl, the command would look something like the following example:

curl -u username:password -d "userToken=38651614-99ca-4ec8-90ce-334475abc0f4" https://mymainframe:161616/cra/ServiceGateway/Services/MVA/getData?product=MVMVS&select=JCPU



Was this page helpful? Yes No Submitting... Thank you

Comments