Chat now with support
Chat mit Support

Foglight 6.0.0 - REST API Reference Guide

Authenticating with tokens

Foglight REST API requests require authentication via a token included in the request Header. Foglight can use two types of tokens:

Auth Token - You can authenticate with an Auth Token set in the Foglight Users & Security dashboard. This eliminates the need to pass your user credentials to Foglight.

Regardless of which approach is used to retrieve the session token, a successful response should be similar to the response in the image below.

Token usage

To authenticate API requests, include the Auth-Token field in your request header with the token value retrieved above.

REST API Foglight Registry Variables

The table below lists the registry variables used by the Foglight REST API. These variables are created by the Forge-RestAPI cartridge. These registry variables specify the default behavior of the REST API and can be modified by the parameters listed in Query Parameters.

 

REST_Audit_Enable

Boolean

Specifies whether the audit feature is enabled in the REST API. Enable is set by default. The audit logs can be found in the Audit dashboard.

REST_Audit_Filter

String

If the resource name is specified using this variable, audit logs of specified resources cannot be found in the Audit dashboard and the audit feature is disabled.

Regular expression is also supported. The resource name is the part following "api" in the URL address. For example, for the URL address is http://<server>:<port>/api/v1/topology/query, the resource name is “v1/topology/query".

REST_DisabledAPI

String

Specifies the REST API that is disabled by default. “Run Script” is set by default, which means Script — Run Script will be disabled after the installation.

REST_MaxDepth

Integer

Specifies the expansion depth of a global object. This value starts from 0, and the default value is 1. Take the Host object as an example:

REST_MaxObjectCount

Integer

Specifies how many objects are invoked through a response. An object is one instance that contains multiple properties.

REST_RetrieveMetricCurrentValue

Boolean

Specifies whether to retrieve the metric current value of a topology object in a response. False is set by default.

REST_RetrieveObservationValue

Boolean

Specifies whether to retrieve the observation current value of a topology object in a response. False is set by default.

REST_ShowLinks

Boolean

Specifies whether to show the link field through a response. False is set by default. The link field includes the following two types:

REST_TokenExpirationTime

Integer

Specifies the token expiration time (in seconds). This variable takes effect when the token is accessed, when a login attempt using a new API or an API request is received on the server side, for example.

REST_CrossOriginResourceAllowedDomain

String

Specifies whether the request from the third-party integration site can be allowed. This variable has no default value.

REST_AccessControlAllowCredentials

Boolean

Specifies whether the response to a request can be exposed to the page. If the returned value is:

REST_ShowTopologyTypeLocalProperties

Boolean

Specifies whether to show the property of Topology Object type in an instance. False is set by default.

REST_AgentSubmitInfoObservationDuration

Integer

Specifies the observation duration of the agents property in the RestAPIInfo type. The default value is 300, which is identical to 5 minutes.

REST_AgentSubmitInfoQueueSize

Integer

Specifies the cache size that stores the detailed information of submitted data. The default value is 100.

Query Parameters

Most of registry variables listed in Table 2: URL parameters can be overwritten by the following URL parameters per request.

maxObjectCount

Specifies how many objects are invoked through a response. An object is one instance that contains multiple properties.

maxDepth

Specifies the expansion depth of the global object. This value starts from 0, and the default value is 1. Take the Host object as an example:

durationMS

Specifies the time duration, including startTimeMS and endTime. If startTimeMS is not set, the endTime value is used as the current time, and the startTime value is calculated as endTime minus the specified duration.

startTimeMS

Specifies the startTime. The endTime is the sum of startTime and durationMS.

retrieveMetricValue

Specifies whether to retrieve the metric current value of a Topology object in a response.

retrieveObservationValue

Specifies whether to retrieve the observation current value of a Topology object in a response.

showLinks

Specifies whether to show the link field through a response. False is set by default. The link field includes the following types:

excludePropertyPatterns

Excludes the properties in a Topology object. Take http://<server>:<port>/api/v1/type/Host/instances?excludePropertyPatterns=.*Alarm.*,.*State.* as an example, this URL address excludes the properties which name contains "Alarm" and "State".

includePropertyPatterns

Includes the properties in a Topology object. Take http://<server>:<port>/api/v1/type/Host/instances?includePropertyPatterns=.*Alarm.*,.*State.* as an example, this URL address includes the properties which name contains "Alarm" and "State".

NOTE: If excludePropertyPatterns and includePropertyPatterns are set to the same value, the value set in excludePropertyPatterns is ignored.

showTopologyTypeLocalProperties

Specifies whether to show the property of the Topology type in an instance.

 

Verwandte Dokumente

The document was helpful.

Bewertung auswählen

I easily found the information I needed.

Bewertung auswählen