Using local environment variables with REST nodes
The REST request nodes support a number of local environment message tree variables, which you can use to dynamically alter the values that are set in the node properties.
The following table shows elements in the LocalEnvironment.Destination.REST.Request message tree, which can be used to override properties in the RESTRequest and RESTAsyncRequest nodes. Any properties that are set by the local environment variables will apply to both the RESTRequest and RESTAsyncRequest nodes.
| Element name | Type | Description |
|---|---|---|
| Operation | string | The value is the name of the operation to invoke
in the REST API. This environment variable overrides the Operation property
on the node. For example: |
| Parameters.parameter_name | string | Specify values to use for the parameters of the operation. The values that are
specified in the LocalEnvironment override any literal values or XPath/ESQL expressions that are
specified in the Parameters table on the node. For
example:Note: If
the values are XPath/ESQL expressions, the values are passed to the remote REST API as string
literals (and not evaluated as XPath/ESQL expressions).
To define the REST parameters and
set their values in a message map, use the Add User Defined function to add the
To specify an array parameter, define the parameter multiple times. For example, an array property
that is called list with values 'a', 'b', and 'c', can be defined as:
To specify an object parameter, specify the object properties
and their values as children of the element. For example, an object parameter called the parameter
multiple times. For example, an array property that is called color with values red = 100, green =
200, and blue = 300, can be defined as:
|
| ContentType | string | The value is the value of the Content-Type header
to send in the request to the REST API. This environment variable
overrides the Content-Type property on the node.
For example: |
| Accept | string | The value is the value of the Accept header
to send in the request to the REST API. This environment variable
overrides the Accept property on the node. For
example: |
| SecurityIdentity | string | The value must be the name of a security identity that is defined with the
mqsicredentials, ibmint set credential, or mqsisetdbparms command. Do not include the "rest::" prefix. This
environment variable overrides the Security identity property on the node. For
example: |
| UserID | string | If this environment variable is specified, it
overrides all the values that are specified by the LocalEnvironment.Destination.REST.Request.SecurityIdentity override
and the Security identity property on the node. If
the |
| Password | string | If this environment variable is specified, it
overrides all the values that are specified by the LocalEnvironment.Destination.REST.Request.SecurityIdentity override
and the Security identity property on the node. If
the |
| APIKey | string | If this environment variable is specified, it
overrides all the values that are specified by the LocalEnvironment.Destination.REST.Request.SecurityIdentity override
and the Security identity property on the node. The |
| BearerToken | string |
If this environment variable is specified, it overrides all the values that are specified by the LocalEnvironment.Destination.REST.Request.SecurityIdentity override and the Security identity property on the node. The |
| Timeout | integer | The time (in seconds) that the node waits for
the REST API to process the operation. This environment variable overrides
the Request timeout (sec) property on the node.
For example: |
| BaseURL | string | This environment variable overrides the Base
URL override property on the node, and the base URL specified
in the Swagger document containing the definitions of the REST API.
For example: |
| ProxyURL | string | This environment variable overrides the HTTP(S)
proxy location property on the node. For example: |
| FollowRedirection | boolean | This environment variable overrides the Follow
HTTP(S) redirection property on the node. For example: |
| KeepAlive | boolean | This environment variable overrides the Enable
HTTP 1/1 keep-alive property on the node. For example: |
| Compression | string | This environment variable overrides the Compression property
on the node. Valid values are:
|
| Protocol | string | This environment variable overrides the Protocol property
on the node. Valid values are:
|
| AllowedCiphers | string | This environment variable overrides the Allowed
SSL Ciphers property on the node. For example: |
| HostnameChecking | boolean | This environment variable overrides the Enable
SSL certificate hostname checking property on the node.
For example: |
| KeyAlias | string | This environment variable overrides the SSL
client authentication key alias property on the node. For
example: |
| EnableCRLCheck | boolean | This environment variable overrides the Enable
certificate revocation list checking property on the node.
For example: |
| AcceptCompressedResponses | string | This environment variable overrides the Accept
compressed responses by default property on the node. For
example: |
| ServicePrincipalName | string | Specifies the Service Principal Name (SPN) to
use when the integration node negotiates the Kerberos security protocol.
For example: |
| SecuritySchemes.security_scheme.SecurityIdentity | string | Specifies the name of a security identity to use for the specified security
scheme. The specified security identity is used only for the specified security scheme. If this
environment variable is specified, it overrides the
The name of the security scheme corresponds to the name of a Security Scheme Object in a Security Definitions Object in the Swagger document containing the definitions of the REST API. The value must be the name of a security identity defined with the mqsicredentials, ibmint set credential, or mqsisetdbparms command. Do not include the "rest::" prefix. For example: |
| SecuritySchemes.security_scheme.UserID | string | Specify the user ID to use for the specified
security scheme when using HTTP Basic Authentication. The specified
user ID is used only for the specified security scheme. If this
environment variable is specified, it overrides the user ID specified
in a security identity using either the The name of the security scheme corresponds to the name
of a Security Scheme Object in a Security Definitions Object in the
Swagger document containing the definitions of the REST API. For
example:
|
| SecuritySchemes.security_scheme.Password | string | Specify the password to use for the specified security scheme when using HTTP
Basic Authentication. The specified password is used only for the specified security scheme. If
this environment variable is specified, it overrides the password that is specified in a security
identity using either the
The name of the security
scheme corresponds to the name of a Security Scheme Object in a Security Definitions Object in the
Swagger document containing the definitions of the REST API. For
example:
|
| SecuritySchemes.security_scheme.APIKey | string | Specify the API key to use for the specified security scheme when using HTTP
Basic Authentication. The specified API key is used only for the specified security scheme. If
this environment variable is specified, it overrides the API key that is specified in a security
identity using either the
The name of the security
scheme corresponds to the name of a Security Scheme Object in a Security Definitions Object in the
Swagger document containing the definitions of the REST API. For
example:
|
| SecuritySchemes.security_scheme.BearerToken | string |
Specify the bearer token to use for the specified security scheme when using HTTP Bearer Authentication. The specified bearer token is used only for the specified security scheme. If this environment variable is specified, it overrides the bearer token that is specified in a
security identity using either the The name of the security scheme corresponds to the name of a Security Scheme Object in a Security
Definitions Object in the openapi document containing the definitions of the REST API. For example:
|
| UserContext | mixed content | Specify context data to be stored by the RESTAsyncRequest node. The
data can later be accessed by the RESTAsyncResponse node for
the matching request. You can use the user context to specify data
that will be passed from the RESTAsyncRequest node to the RESTAsyncResponse node. To
store user context data, prior to the RESTAsyncRequest node, either
set a value in the For example,
to set the values by using an ESQL expression:
You
can use a Mapping node
to set a value, by mapping to the mixed child element To
access the user context data after a RESTAsyncResponse node, read
the value or children of the |
| QueryStringDoNotPercentEncodeCharacters | String | Specifies those characters in the query string that are not to be
percent encoded while the URI is built. For example, to specify that the comma and greater than
symbols are not to be percent
encoded:
The
default set of characters not to be percent encoded is asterisk ( |
| Element | Type | Description |
|---|---|---|
| LocalEnvironment.WrittenDestination.REST.Method | string | The HTTP method used when invoking the operation in the REST API. |
| LocalEnvironment.WrittenDestination.REST.URL | string | The URL used when invoking the operation in the REST API. |
| LocalEnvironment.WrittenDestination.REST.RequestHeadersSize | integer | The size of the request headers sent to the REST API. |
| LocalEnvironment.WrittenDestination.REST.RequestBodySize | integer | The size of the request body that is sent to the REST API. |
| LocalEnvironment.WrittenDestination.REST.StatusCode | integer | The HTTP status code in the response from the REST API. |
| LocalEnvironment.WrittenDestination.REST.ResponseHeadersSize | integer | The size of the response headers received from the REST API. |
| LocalEnvironment.WrittenDestination.REST.ResponseBodySize | integer | The size of the response body received from the REST API. |
| LocalEnvironment.WrittenDestination.REST.TotalRequestTime | integer | The total elapsed time invoking the operation in the REST API. |
| LocalEnvironment.WrittenDestination.REST.ResponseCode | string |
The HTTP status code, or status code range defined on responses section the invoked operation in the OpenAPI document. If the status code is not in the list of expected response codes, then the status code as a string is as follows: For example, if the responses section lists status codes 200, and 2XX, then a response with StatusCode of 200 will have a ResponseCode of 200, but a response of StatusCode 204 will have a ResponseCode of 2XX, and a response with a StatusCode of 300 will have a ResponseCode of 300. |
| LocalEnvironment.WrittenDestination.REST.ResponseCodeExpected | boolean |
True if the HTTP status code for the response appeared in the list of expected response codes that are defined on the operation in the OpenAPI document. For example, if the responses section lists status codes 200, and 2XX, then a response with StatusCode of 200 or 204 will have a ResponseCodeExpected of TRUE, but a response with StatusCode of 300 will have a ResponseCodeExpected of FALSE. |
| Element | Type | Description |
|---|---|---|
| LocalEnvironment.WrittenDestination.REST.Method | string | The HTTP method used when invoking the operation in the REST API. |
| LocalEnvironment.WrittenDestination.REST.URL | string | The URL used when invoking the operation in the REST API. |
| LocalEnvironment.WrittenDestination.REST.RequestHeadersSize | integer | The size of the request headers sent to the REST API. |
| LocalEnvironment.WrittenDestination.REST.RequestBodySize | integer | The size of the request body that is sent to the REST API. |
| LocalEnvironment.WrittenDestination.REST.CorrelationID | blob | The correlation ID used to correlate the request and response between the RESTAsyncRequest and RESTAsyncResponse nodes. |
| Element | Type | Description |
|---|---|---|
| LocalEnvironment.REST.Response.CorrelationID | blob | The correlation ID used to correlate the request and response between the RESTAsyncRequest and RESTAsyncResponse nodes. |
| LocalEnvironment.REST.Response.StatusCode | integer | The HTTP status code in the response from the REST API. |
| LocalEnvironment.REST.Response.ResponseHeadersSize | integer | The size of the response headers received from the REST API. |
| LocalEnvironment.REST.Response.ResponseBodySize | integer | The size of the response body received from the REST API. |
| LocalEnvironment.REST.Response.UserContext | mixed content | The information that was stored in the OutputLocalEnvironment.Destination.REST.Request.UserContext can be retrieved by the response thread. |
| LocalEnvironment.REST.Response.ResponseCode | string |
The HTTP status code, or status code range defined on responses section the invoked operation in the OpenAPI document. If the status code is not in the list of expected response codes, then the status code as a string is as follows: For example, if the responses section lists status codes 200, and 2XX, then a response with StatusCode of 200 will have a ResponseCode of 200, but a response of StatusCode 204 will have a ResponseCode of 2XX, and a response with a StatusCode of 300 will have a ResponseCode of 300. |
| LocalEnvironment.REST.Response.ResponseCodeExpected | boolean |
True if the HTTP status code for the response appeared in the list of expected response codes that are defined on the operation in the OpenAPI document. For example, if the responses section lists status codes 200, and 2XX, then a response with StatusCode of 200 or 204 will have a ResponseCodeExpected of TRUE, but a response with StatusCode of 300 will have a ResponseCodeExpected of FALSE. |