POST /metrics_service/subscriptions

Use this method to create a metrics forwarder.

Note: This API requires Lenovo XClarity Administrator v2.8.0 or later.

Authentication

Authentication with user name and password is required.

Request URL

POST https://<management_server_IP>/metrics_service/subscriptions

Query parameters

None

Request body

Parameter Required / Optional Type Description
authUser Required if restAuthentication is set to "basic" String Authentication user ID if authentication is used
authPassword Required if restAuthentication is set to "basic" String Authentication password if authentication is used
description Optional String Description for the metrics forwarder
enable Optional Boolean Indicates whether the metrics forwarder is enabled. This can be one of the following values.
  • true. (default) The metrics forwarder is enabled.
  • false. The metrics forwarder is disabled.
ipAddress Required String IPv4 or IPv6 address or hostname of the remote system that is the target to receive the metrics. For email, this is the SMTP server.
name Required String User-defined name for the metrics forwarder. This name must be unique for all metrics forwarders.
port Optional String TCP/UDP port used for the connection
restAuthentication Optional String Authentication type. This can be one of the following values.
  • basic. (default) Authenticates to the specified server using the specified user ID (authUser) and password (authPassword).
  • none. (default) No authentication is used.
restPath Optional String Resource path on which the forwarder is to post the metrics

The default path is /api/v1/inbound/metrics.

The following example creates a metrics forwarder.

{
   "authUser": "ADMIN",
   "authPassword": "********",
   "description": "Metrics subscription",
   "enable": "true",
   "ipAddress": "192.0.2.40",
   "name": "Metrics_subscription",
   "port": "443",
   "restAuthentication": "basic",
   "restPath": "/api/v1/metrics"
}

Response codes

Code Description
200 OK
404 Bad request
500 Internal server error

Response body

Parameters Type Description
id String Metrics forwarder (subscription) ID

Response example

{
   "id": "5e3279917f30b2de48e905b5"
}