Chatee ahora con Soporte
Chat con el soporte

Foglight 6.1.0 - REST API Reference Guide

Rule

The Rule related APIs include the following:

API Name: Get all rules’ data
Description: Get data of all rules.
API path: /api/v1/rule/allRules
Sample usage: http://<server>:<port>/api/v1/rule/allRules
API Name: Get rule by ID
Description: Filter out rules by a rule ID.
API path: /api/v1/rule/ruleId
Sample usage: http://<server>:<port>/api/v1/rule/ruleId

Script

The Script related API includes the following:

API Name: Run Script
Description: You need be granted both the Administrator and API Access roles to use this API. This API is similar to the script console, but it does not support functionHelper, log, and out variables that are supported in the script console.
This API is disabled by default after the installation. Refer to the REST_DisabledAPI Registry Variable in Table 2 for more information about how to change this configuration.
API path: /api/v1/script/runScript
NOTE: If you use & in your sample codes, make sure to convert it to &amp;.
API Name: Publish custom REST API
Description: The Management Server provides the capability for publishing custom REST API with scripts. To run scripts of custom REST API, ensure that the value of Choose an Associated Cartridge (Optional) is set to Forge-RestAPI in the Administration > Tooling > Script Console > Scripts > Add > Run Script dialog box. This API is a runtime registration, so the registered custom REST APIs will be lost after restarting the server.
Request type: Depends on the API definition.
API path: Depends on the API definition.
Sample usage: See below for the template about how to publish a custom REST API.
After running the above codes in the Script Console dashboard, you can access this API with the http://<fms_ip>:<fms_port>/api/v1/echo/host URL.
Use rrm.registerRestAPIExtension (replaces MyRestAPIExtension()) to register the custom API.
Use rrm.unregisterRestAPIExtensions (DummyCartridge) to remove the custom API.
The @Path annotation is used to define the relative URI path.
The @Get annotation is used to define the request type.
The @Produces annotation is used to define the MIME media types of representations a resource can produce and send back to the client.
The @Secured annotation is used to define whether the access token is required. If @Secured is used, Access-Token must be set in the request header.
Header: Depends on the API definition.
API Name: Run named scripts
Description: Foglight supports embedding named scripts into cartridges by editing the monitoring policy XML. This API is used to call those named scripts.
API path: /api/v1/script/runNamedScript?scriptName=<namedScriptName>&param=<script_parameter>
Sample usage: Consider for example there is a named script called 'getHostById', this named script requires the host instance id which type is string, then the sample API should be following: http://sever_url:port/api/v1/script/runNamedScript?scriptName=getHostById&param=b1b3ad72-2460-4576-b1ec-3ffd57016deb.
Header:

Subscribe alarm

The Subscribe related APIs include the following:

API Name: Disconnect SSE
Description: Disconnect all the active Server-Sent Events (SSE) subscriptions.
API path: /api/v1/subscription/disconnect/all/
Sample usage: http://<server>:<port>/api/v1/subscription/disconnect/all/
API Name: List SSE
Description: Filter out all the active SSE subscriptions.
API path: /api/v1/subscription/list/
Sample usage: http://<server>:<port>/api/v1/subscription/list
API Name: Subscribe alarms by object ID
Description: Watch the topology object by its topologyId, and subscribe to alarm-generated events through SSE. When the client is disconnected, there is no retry mechanism to send an event to the client. For more information, visit Server-Sent Events (SSE) Support and Server-Sent Events.
NOTE: If the version of your Foglight Management Server is lower than 5.7.5.7, open the server.xml file under <fms_home>/server/tomcat/, then add asyncSupported="true" to all value items (for example, <Valve className="com.quest.nitro.web.tomcat.HttpsRedirectValve" asyncSupported="true"/>).
API path: /api/v1/subscription/alarm/subscribe/topologyId
API Name: Subscribe to all alarms
Description: Subscribe to alarm-generated events through SSE. When the client is disconnected, there is no retry mechanism to send an event to the client. For more information, visit Server-Sent Events (SSE) Support and Server-Sent Events.
NOTE: If the version of your Foglight Management Server is lower than 5.7.5.7, open the server.xml file under <fms_home>/server/tomcat/, then add asyncSupported="true" to all value items (for example, <Valve className="com.quest.nitro.web.tomcat.HttpsRedirectValve" asyncSupported="true"/>).
API path: /api/v1/subscription/alarm/subscribe

Topology

The Topology related APIs include the following:

API Name: Get properties’ value
Description: Get properties of one topology object based on path. This topology object is specified by uniqueId.
API path: /api/v1/topology/topologyId/paths
Sample usage: http://<server>:<port>/api/v1/topology/3546fa55-11b6-4943-b7cb-84ddcf350bc5/paths?path=name&path=uniqueId&path=utilization
API Name: Get property value
Description: Get property values by the path defined based on the given topology ID. The result may be DataObject, Primitive Object, Observation, or else.
API path: /api/v1/topology/topologyId/path
Sample usage: http://<server>:<port>/api/v1/topology/abc94b3d-f599-4766-a979-f32d372ff47d/cpus/utilization
API Name: Get topology object by IDs
Description: Filter out topology objects by an object ID.
API path: /api/v1/topology/topologyObjectId
Sample usage: http://<server>:<port>/api/v1/topology/1f478dec-f920-4da9-a8d2-b9ba0dcd4394
API Name: Get topology object by ids
Description: Filter out topology objects by multiple IDs.
API path: /api/v1/topology/topologyIds
Sample usage: http://<server>:<port>/api/v1/topology/topologyIds?Id=3546fa55-11b6-4943-b7cb-84ddcf350bc5&Id=67beea68-fa6f-4cd3-b122-dcb20db50360
API Name: Observations query
Description: Filter out observations value by a batch query. The following lists the retrievalType:
API path: /api/v1/topology/batchQuery
API Name: TopologyObject query
Description: Filter out topology objects by a batch query.
API path: /api/v1/topology/query
API Name: Push data
Description: Push data to an existing topology object. The request body should be RAW data and the basic format can be set as below:
Ensure that the data type (typeName) already exists in the server; otherwise this operation will fail.
If the data type is a new type, import this type by selecting Dashboards > Administrator > Data > Add Topology Type. Click the Help tab in the Add Topology Type dashboard to understand details of this new type.
To find the identity property of a type, select Dashboards > Development Tools > Schema Browser (ensure that you have the Cartridge Developer role). If the identity property is a topology object, you can use the object unique ID as its reference. Fore more information, refer to the following Sample usage section.
The identity of Host type (hostId) is generate by some fields, so set the name and hostId properties at least if you want to create a host.
If you see the message like “The rest agent cache queue is full...” in the log file, increase the value of the REST_AgentSubmitInfoQueueSize Registry Variable, and then run the following script in the Run Script dialog box. To run the following script, ensure that the value of Choose an Associated Cartridge (Optional) is set to Forge-RestAPI in the Administration > Tooling > Script Console > Scripts > Add > Run Script dialog box.
API path: /api/v1/topology/pushData
Case 1: Create a general topology type instance. Consider for example we create an FSMAgentBlackout type instance. Find the identity of type FSMAgentBlackout is name in the Schema Browser dashboard. Use the following request body to create the FSMAgentBlackout type instance.
Case 2: Create a Host instance. If you want to submit Host type data, the name property is mandatory while vmId and systemId properites are optional. You can set both optional properties if you know their values. hostId is automatically generated based upon values of name, systemId, and vmId, so it is not required to set manually.
Case 3: Create a type instance which identity property is a topology object. Consider for example we create a HostProcess type instance. In the Schema Browser dashboard, find the identity properties of type HostProcess are name and os. The name property is a string, while the os property is OperatingSystem which is a topology type. Use the uniqueId of OperatingSystem as the reference, then create the HostProcess type instance as follows.
Case 4: Create a custom type instance. Consider for example we have imported the below type definition in the Add Topology Type dashboard.
The identity property is name in the above type definition. Use the following request body to create the custom type instance:
Case 5: Consider for example we have the following type definition.
Case 6: Consider for example we have the following type definition.

The document was helpful.

Seleccionar calificación

I easily found the information I needed.

Seleccionar calificación