Using the curl command to access the retriever MBeans

Draft comment:
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15
You can use the curl command to view process and BPEL retriever MBean attributes that are in read-only mode.

Querying all the MBean attributes for a retriever

All the remotely accessible MBean attributes for the retrievers are returned by the REST API endpoint: GET /IBMJMXConnectorREST/mbeans/{MBean objectName}/attributes. The corresponding curl command to access this endpoint is:
  • For BPD retrievers:
    curl –X GET -s -u user:password -k 'https://hostname:port/IBMJMXConnectorREST/mbeans/com.ibm.bpm.federation.server:name=retrieverUniqueID,subtype=BpdRetrievers,type=Retrievers/attributes’
  • For BPEL retrievers:
    curl –X GET -s -u user:password -k 'https://hostnameport/IBMJMXConnectorREST/mbeans/com.ibm.bpm.federation.server:name=retrieverUniqueID,subtype=BpelRetrievers,type=Retrievers/attributes’
    
  • user is the user name, and password is the password of a Liberty user that has an administrative role.
  • hostname is the Process Federation Server hostname.
  • port is the HTTPS port.
  • retrieverUniqueID is the string based on the ID of the retriever and of the federated system it refers to (for more information, see the MBean objectName section in MBeans for process retrievers and MBeans for BPEL retrievers.)
This command returns the MBean attributes for the retriever as an array of JSON objects such as:
[
{"name": attributeName1,"value":{"value":attributeValue1,"type":attributeType1}},
{"name": attributeName2,"value":{"value":attributeValue2,"type": attributeType2}},
 …
]
This command returns an exception encapsulated in a JSON object when:
  • the MBean is not yet registered on Process Federation Server.
  • the federated system ID refers to a federated system that does not exist, or that is not running.

Querying a specific MBean attribute for a retriever

The value of a specific MBean attribute for a retriever is returned by the REST API endpoint: GET /IBMJMXConnectorREST/mbeans/{MBean objectName}/attributes/{attributeName}. The corresponding curl command to access this endpoint is:
  • For process retrievers:
    curl –X GET -s -u user:password -k 'https://hostname:port/IBMJMXConnectorREST/mbeans/com.ibm.bpm.federation.server:name=retrieverUniqueID,subtype=BpdRetrievers,type=Retrievers/attributes/attributeName'
    
  • For BPEL retrievers:
    curl –X GET -s -u user:password -k 'https://hostname:port/IBMJMXConnectorREST/mbeans/com.ibm.bpm.federation.server:name=retrieverUniqueID,subtype=BpelRetrievers,type=Retrievers/attributes/attributeName'
    
  • user is the user name, and password is the password of a Liberty user that has an administrative role.
  • hostname is the Process Federation Server hostname.
  • port is the HTTPS port.
  • attributeName is a valid attribute that is remotely accessible by the retriever MBean.
This command returns the MBean attribute as a JSON object such as:
{"value": attributeValue,"type": attributeType}
Example
curl –X GET -s -u uid=admin,o=defaultWIMFileBasedRealm:admin -k 'https://pfsHost.com:9443/IBMJMXConnectorREST/mbeans/com.ibm.bpm.federation.server:name=bpd1.default-0,
subtype=BpdRetrievers,type=Retrievers/attributes/connectionTimeout'
{"value":"10000","type":"java.lang.String"}’
Note: The attribute name is case sensitive.
This command returns an exception encapsulated in a JSON object when:
  • the MBean is not yet registered on Process Federation Server.
  • the federated system ID refers to a federated system that does not exist or that is not running.
  • the attribute name does not exist