Attaching a monitoring profile by using the administration REST API

You can use the IBM® App Connect Enterprise administration REST API to attach a monitoring profile to an application and the message flows that are packaged with it. You can also attach a monitoring profile to an individual message flow that is deployed in an application or static library.

Before you begin

Read the following topics:

Follow the instructions in Creating a monitoring profile to learn how to create a monitoring profile.

After you have created the monitoring profile, save it in a policy project and deploy the policy project in either an independent BAR file or in the same BAR file as an associated application or message flow. Attach the monitoring profile to an application or message flow. You can then activate monitoring by using the administration REST API as described in Activating monitoring by using the administration REST API.

About this task

The examples in this topic are based on the following resources:
  • An application: MonitoringApp
  • Message flows packaged with the application: MonitoringAppFlow1 and MonitoringAppFlow2
  • A library associated with the application: Monitoring Lib
  • A message flow in the library: MonitoringLibFlow
  • A policy project: MonitoringPolicyProject
  • A monitoring profile in the policy project: MyMonitoringProfile
as shown in this example Integration Explorer pane excerpt:
The diagram shows a deployment topography that includes an application, 2 message flows that are packaged with the application, a library that is associated with the application, and a message flow that is in the library

Attaching a monitoring profile to an application

About this task

You can attach a monitoring profile to an application and it message flows, or you can attach a monitoring profile to a single message flow:

Procedure

  • Attach a monitoring profile to an application and its message flows:
    1. For an independent integration server:
      POST http://hostname:port/apiv2/applications/applicationName/attach-monitoring-profile

      For example, to attach the monitoring profile MyMonitoringProfile to the application MonitoringApp, use the following curl command:

      curl -X POST "http://hostname:port/apiv2/applications/MonitoringApp/attach-monitoring-profile?profile=MyMonitoringProfile&project=MonitoringPolicyProject"
    2. For an integration server that is managed by an integration node:
      POST http://hostname:port/apiv2/servers/integrationServerName/applications/applicationName/attach-monitoring-profile

      For example, to attach the monitoring profile MyMonitoringProfile to the application MonitoringApp on integration server ACESERV1, use the following curl command:

      curl -X POST "http://hostname:port/apiv2/servers/ACESERV1/applications/MonitoringApp/attach-monitoring-profile?profile=MyMonitoringProfile&project=MonitoringPolicyProject"

      If the command is successful, an HTTP status code 200 is returned.

  • Attach a monitoring profile to a single message flow:
    1. For an independent integration server:
      POST http://hostname:port/apiv2/applications/applicationName/messageflows/messageflowName/attach-monitoring-profile

      For example, to attach the monitoring profile MyMonitoringProfile to the message flow MonitoringAppFlow1, use the following curl command:

      curl -X POST "http://hostname:port/apiv2/applications/MonitoringApp/messageflows/MonitoringAppFlow1/attach-monitoring-profile?profile=MyMonitoringProfile&project=MonitoringPolicyProject"

      If the message flow is in a library:

      POST http://hostname:port/apiv2/applications/applicationName/libraries/libraryName/messageflows/messageflowName/attach-monitoring-profile

      For example, to attach the monitoring profile MyMonitoringProfile to the message flow MonitoringLibFlow, use the following curl command:

      curl -X POST "http://hostname:port/apiv2/applications/MonitoringApp/libraries/MonitoringLib/messageflows/MonitoringLibFlow/attach-monitoring-profile?profile=MyMonitoringProfile&project=MonitoringPolicyProject"
    2. For an integration server that is managed by an integration node:
      POST http://hostname:port/apiv2/servers/integrationServerName/applications/applicationName/messageflows/messageflowName/attach-monitoring-profile

      For example, to attach the monitoring profile MyMonitoringProfile to the message flow MonitoringAppFlow1 on integration server ACESERV1, use the following curl command:

      curl -X POST "http://hostname:port/apiv2/servers/ACESERV1/applications/MonitoringApp/messageflows/MonitoringAppFlow1/attach-monitoring-profile?profile=MyMonitoringProfile&project=MonitoringPolicyProject"

      If the message flow is in a library:

      POST http://hostname:port/apiv2/servers/integrationServerName/applications/applicationName/libraries/libraryName/messageflows/messageflowName/attach-monitoring-profile

      For example, to attach the monitoring profile MyMonitoringProfile to the message flow MonitoringLibFlow on integration server ACESERV1, use the following curl command:

      curl -X POST "http://hostname:port/apiv2/servers/ACESERV1/applications/MonitoringApp/messageflows/MonitoringLibFlow/attach-monitoring-profile?profile=MyMonitoringProfile&project=MonitoringPolicyProject"

      If the command is successful, an HTTP status code 200 is returned.

What to do next

You can use the mqsireportflowmonitoring command to verify that the monitoring profile has been attached to the application or message flow.

Attaching a monitoring profile to a REST API integration solution

Procedure

  • Attach a monitoring profile to a REST API integration solution and its message flows:
    1. For an independent integration server:
      POST http://hostname:port/apiv2/rest-apis/rest-apiName/attach-monitoring-profile
    2. For an integration server that is managed by an integration node:
      POST http://hostname:port/apiv2/servers/integrationServerName/rest-apis/rest-apiName/attach-monitoring-profile

      If the command is successful, an HTTP status code 200 is returned.

  • Attach a monitoring profile to a single message flow:
    1. For an independent integration server:
      POST http://hostname:port/apiv2/rest-apis/rest-apiName/messageflows/messageflowName/attach-monitoring-profile

      If the message flow is in a library:

      POST http://hostname:port/apiv2/rest-apis/rest-apiName/libraries/libraryName/messageflows/messageflowName/attach-monitoring-profile
    2. For an integration server that is managed by an integration node:
      POST http://hostname:port/apiv2/servers/integrationServerName/rest-apis/rest-apiName/messageflows/messageflowName/attach-monitoring-profile

      If the message flow is in a library:

      POST http://hostname:port/apiv2/servers/integrationServerName/rest-apis/rest-apiName/libraries/libraryName/messageflows/messageflowName/attach-monitoring-profile

      If the command is successful, an HTTP status code 200 is returned.

What to do next

You can use the mqsireportflowmonitoring command to verify that the monitoring profile has been attached to the application or message flow.

Attaching a monitoring profile to an integration services integration solution

Procedure

  • Attach a monitoring profile to an integration service integration solution and its message flows:
    1. For an independent integration server:
      POST http://hostname:port/apiv2/services/integrationServiceName/attach-monitoring-profile
    2. For an integration server that is managed by an integration node:
      POST http://hostname:port/apiv2/servers/integrationServerName/services/integrationServiceName/attach-monitoring-profile

      If the command is successful, an HTTP status code 200 is returned.

  • Attach a monitoring profile to a single message flow:
    1. For an independent integration server:
      POST http://hostname:port/apiv2/services/intergrationServiceName/messageflows/messageflowName/attach-monitoring-profile

      If the message flow is in a library:

      POST http://hostname:port/apiv2/services/integrationServiceName/libraries/libraryName/messageflows/messageflowName/attach-monitoring-profile
    2. For an integration server that is managed by an integration node:
      POST http://hostname:port/apiv2/servers/integrationServerName/services/intergationServiceName/messageflows/messageflowName/attach-monitoring-profile

      If the message flow is in a library:

      POST http://hostname:port/apiv2/servers/integrationServerName/services/integrationServiceName/libraries/libraryName/messageflows/messageflowName/attach-monitoring-profile

      If the command is successful, an HTTP status code 200 is returned.

What to do next

You can use the mqsireportflowmonitoring command to verify that the monitoring profile has been attached to the application or message flow.