Configuring the REST adapter

You configure the adapter on Grid Manager. 

Adapter type: ro-adapter-rest_vv.rr.nn

Default adapter name: RESTAdapter 

The Properties field in the adapter configuration of Grid Manager is a required field. If the default values are acceptable for all elements, you can enter a configuration node, <config/>, in the Properties field. When you set a configuration node, the adapter uses the default values for all the elements.

BMC recommends that you do not include unused elements in the adapter configuration because they might cause the adapter to enter a fault state. 

To configure the REST adapter

  1. Log on to the TrueSight Orchestration Grid Manager.
  2. Click the Manage tab; then click the Adapters tab.
  3. In the Adapters in Repository list, select the ro-adapter-rest_vv.rr.nn check box.
  4. Click Add to Grid to include the adapter in the Adapters on Grid list.
  5.  Click Configure corresponding to the newly added adapter.
  6. On the Add an Adapter Configuration page, perform the following substeps to configure the adapter using the form view or jump to step 7 to configure the adapter using the XML view:
    1.  Enter a name for the adapter.
      The default name of the REST adapter is RESTAdapter.
    2.  Enter a description for the adapter.
    3. Under Properties, enter or select values for the configuration elements. 

      The configuration elements for each adapter are described in that adapter's section. Include all required elements indicated with an asterisk (*).
    4. (Optional) Click Switch to XML View and use the following steps to specify elements and attributes that are not in the form view.

      Note

      Switching to the XML view to specify those elements and attributes not included in the form means that you cannot thereafter use the form for modifying that configuration. This step is not required for base adapters that can be fully configured using the form.s

  7. On the Warning message that appears, click Switch View.
  8. In the Properties text box, use XML format to enter the configuration elements and attributes not available as fields in the form view.
  9. Click OK.
  10.  (Optional) Configure the adapter in the XML view using the following sub-steps:
    1. Enter a name and a description for the adapter.
    2. Click Switch to XML View.
    3. On the Warning message that appears, click Switch View.
    4. Copy the configuration elements and attributes from the appropriate adapter configuration section into the Properties text box, and then click OK.
      If the default value for an optional element is acceptable, omit the element. Do not include empty elements.
    5. On the Warning message that appears, click Save

      This saves the adapter configuration with settings in the XML view permanently. The newly configured adapter is now listed in the Adapters on Grid list. 
      For more information, see Configuring base adapters. 

The following table describes the adapter configuration elements for the REST adapter that you can specify by using the form view, XML view, or both. You cannot use the form view to configure elements and attributes that do not have an entry in the "UI label" column.

UI labelElement nameDescriptionRequired

Data Format

<data-format>

Specifies the format for the output 

The configuration values can be overridden in the adapter request. 

Valid values: XML, JSON

Note: If an invalid value is specified for this element, the default value is used.

No

Request Timeout

<request-timeout>

Specifies the time (in seconds) to wait when establishing a connection 

UPDATED IN 8.1Default value: 60 seconds

No

Character Set

<character-set>

Specifies the supporting CharSet to encode or decode the characters

Also called character set, it includes identifiers describing a series of universal characters.

Examples:

UTF-8

Shift_JIS: Japanese character set

Big5: Traditional Chinese character set

ISO-8859-2: ISO character set for Central European languages

Note: If you do not specify the supporting character set, the adapter response is parsed based on the character set in the HTTP response header.

No

None

<proxy-settings>

Contains the elements that define the HTTP proxy settings 

If you provide this element, you must also specify the <host>and <port> elements. 

You must specify the <user-name> and <password>elements only if the authentication scheme is enabled on the proxy server.

Note: To configure <proxy-settings>, you must switch to XML view as <proxy-settings> are not available as fields in a form view.

No

None

<proxy-ntlm-authentication>

Indicates whether to use NTLM authentication for the specified user credentials with proxy server settings 

The adapter supports both NTLMv1 and NTLMv2 authentication. 

Valid values: true, false (default) 

If the value of the parameter is true, the adapter uses NTLMv1 or NTLMv2 authentication (based on the server configuration) to authenticate the user. Else, the adapter uses basic authentication.

No

None

<host>

Specifies the host name or the IP address of the destination host (proxy server) for the HTTP request 

Note: You can specify an IPv6 address with a zone ID for the <host> element---for example, 
<host>[fe80::5097:4c5e:2289:76dd]</host>

You must specify the IPv6 address in square brackets ([ ]). To find the zone ID of the required computer, see Zone ID for an IPv6 address.

Conditional; required if you use <proxy-settings>

None

<port>

Specifies the destination port on the proxy server for the HTTP request

Conditional; required if you use <proxy-settings>

None

<user-name>

Specifies the name of the user to access the proxy server

Conditional; specify <user-name>only if the authentication scheme is enabled on the proxy server

None

<password>

Specifies the password for the specified user name

Conditional; specify <password>only if the authentication scheme is enabled on the proxy server

None

<signature-properties>

Contains the elements that specify information about the public key (X.509 certificate) and the private key that are used for the digital signature 

The <signature-properties> element can contain the modeattribute that specifies the format in which the public (X.509 certificate) and private keys are provided for signing the HTTP request. 

You can provide the keys using one of the following formats:

  • Java Keystore (JKS)
  • Privacy Enhanced Mail (PEM)
  • Definite Encoding Rules (DER) files
  • Base64-encoded PEM 

    Valid values:
  • <signature-properties mode="keystore"> (default)
  • <signature-properties mode="key-files">
  • <signature-properties mode="key-data">

No

None

<keystore-file>

Specifies the path to the JKS that contains the client certificate

Conditional; required when the signature mode is keystore

None

<key-password>

Specifies the password of the key contained in the JKS 

Note: If you do not specify <key-password>, then the value of <keystore-password> is used as the key password.

No

None

<keystore-password>

Specifies the password to the JKS

Conditional; required when the signature mode is keystore

None

<alias>

Specifies the name of the alias in the JKS that identifies the Public Key Certificate (PKC), which the web server uses to authenticate the client

Conditional; required when the signature mode is keystore

None

<private-key-file>

Specifies the file containing the private key, which is used to sign the HTTP request 

The adapter supports the following formats:

  • Base64-encoded PEM
  • DER

Conditional; required when the signature mode is key-files

None

<certificate-file>

Specifies the file containing the public key (X509 Certificate) 

The adapter supports the following formats:

  • Base64-encoded PEM
  • DER

Conditional; required when the signature mode is key-files

None

<private-key-data>

Contains an XML specifying the private key in an Base64-encoded PEM format 

For example: 
<private-key-data> ---- BEGIN PRIVATE KEY ---- 
MIICdQIBADANBgkqhkiG9w0 
BAQEFAASCAl8wggJbAgEAAo 
GBAKomKro6VbW4PeQtUhNz 
ZpSH26vbBTBtH1r4EjnIv4vnh 
SyyA62ewpROVNn0Spvjo 
BFwE88HcX3tXym/zbVgtd 
Pke9K+SYHP6CWdiLqn 
........ 
---- END PRIVATE KEY ----</private-key-data>

Conditional; required when the signature mode is key-data

None

<certificate-data>

Contains an XML specifying the public key (X509 Certificate) in an Base64-encoded PEM format 

For example: 
<certificate-data> ---- BEGIN CERTIFICATE ---- 
MIICdzCCAeCgAwIBAgIFXseN1xYwDQYJKoZIhvcNAQEFBQ 
AwUzELMAkGA1UEBhMCVVMxEzARBgNVBAoTCkFtYXpvbi5jb20x
DDAKBgNVBAsTA0FXUzEhMB8GA1UEAxMY 
........ 
---- END CERTIFICATE ----</certificate-data>

Conditional; required when the signature mode is key-data

Enable Redirects

<enable-redirects>

Specifies whether the adapter should redirect a URL request to the changed URL location 

Valid values: true (default), false

If you specify <enable-redirects> in the adapter configuration and an adapter request, the values in the request override the values in the configuration.

No

Download attachment

<download-attachment>

Specifies whether the adapter should display the content of the attached file in the adapter response or save the content in a file 

Valid values: true, false (default) 

If <download-attachment>=true, the adapter checks the <content-disposition> field in the response header. If <content-disposition> contains attachment, the adapter saves the attached file. 

If the adapter response header does not contain the content-disposition field, the adapter checks the <content-type> field in the response header. If <content-type> contains an image or an attachment or an audio or a video, the adapter saves the attached file. 

If <download-attachment>=false, the content of the attached file is displayed in the adapter response.

No

Download directory

<download-directory>

Specifies the full path where the attached file must be downloaded 

Default value: Temporary directory of the Java virtual machine of the peer

No

Secure Protocols<secure-protocols>

Specifies the SSL/TLS protocols for establishing a network connection with a target server

You can specify a single string value like SSLv3 or TLSv1 or a list of protocols separated by commas.

Example: TLSv1,TLSv1.1,TLSv1.2

No

The following figure shows an XML template for the REST adapter configuration. 

XML sample for configuring the REST adapter
<config>
   <request-timeout />
   <character-set />
   <proxy-settings>
      <host />
      <port />
      <user-name />
      <password />
      <proxy-ntlm-authentication />
   </proxy-settings>
   <!-- one of the two <signature-properties> -->
   <signature-properties mode="keystore">
      <keystore-file />
      <keystore-password />
      <alias />
      <key-password />
   </signature-properties>
   <signature-properties mode="key-files">
      <private-key-file />
      <certificate-file />
   </signature-properties>
   <enable-redirects />
   <download-attachment />
   <download-directory />
   <secure-protocols />
</config>

Encrypting an element's contents

You can add the attribute secure="true" to an XML adapter element XML view to ensure that the element's contents is encrypted when displayed.

Note

You must be using TrueSight Orchestration Platform version 8.1 or later to use this encryption attribute.

Enabling custom logging

To enable custom logging for the adapter, you must specify a log file name. You can also provide additional parameters for logging.

Note

You must be using TrueSight Orchestration version 8.1 or later to use the custom logging feature. These parameters will be ignored in earlier versions of TrueSight Orchestration Platform.

These parameters are available with supported adapter versions. See TrueSight Orchestration Content documentation for details.

  • Log File Name: Provide a name for the log file.
    This file will be stored in the AO_HOME/tomcat/logs directory. If Log File Max Backup Index value is greater than 0, the log file name is suffixed with the backup index. For example, if the parameter value is a.log, backup log files will have names, such as a.log.1, a.log.2.
  • Log File Size: Specify a size limit for the log file. 
    If the value specified for Log File Max Backup Index is greater than 0, when the specified size is reached, the current file is renamed with the suffix .1. Otherwise, the log file will be reset and over-written. The default value is 10MB. The available units are KiloBytes (KB), MegaBytes (MB) or GigaBytes (GB).
  • Log File Max Backup Index: Enter the maximum number of backup files allowed. The default value is 10.
  • Log File Append: Select this option to append new log information to the existing information in the file. If unselected, the file will be overwritten with new log information.
  • Log Level: Enter the logging level using one of the following choices:

    Logging level

    Description

    DEBUG

    The most detailed logging level; logs low-level messages, normal execution, recoverable erroneous conditions, and unrecoverable erroneous conditions

    INFO

    (default)

    Logs normal execution, recoverable erroneous conditions, and unrecoverable erroneous conditions

    WARN

    Logs recoverable erroneous conditions and unrecoverable erroneous conditions

    ERROR

    The least detailed logging level; logs only error conditions that are not usually recoverable

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

Comments