Generates the badge in SVG format from response of the given HTTP URL by processing the response with the given expression to resolve badge message. In the Globadge side, the execution steps are;
Takes HTTP URL and expression as input
Calls the given HTTP URL and gets the response
Processes the returned result with the given expression to resolve the badge message
Builds the badge from given label and resolve message to return to the client in SVG format
expressionType (*): The type of the expression to be used while resolving badge message from HTTP URL response by message expression. Currently, only jq expressions are supported. This parameter is passed as pathparameter and it is mandatory.
httpURL (*): The HTTP URL to be called with GET method for getting the response which will be used to resolve badge message by message expression. This parameter is passed as query parameter and it is mandatory.
label (*): The text of the badge label. This parameter is passed as query parameter and it is mandatory.
messageExpression (*): The expression to be used for resolving badge message from the response of the HTTP URL. The expression must be valid in the context of the expression type passed as path parameter as mentioned above. Currently, only jq expressions are supported. This parameter is passed as query parameter and it is mandatory.
labelColor: The color of the badge label. The supported colors are listed here. This parameter is passed as query parameter and it is optional.
messageColor: The color of the badge message. The supported colors are listed here. This parameter is passed as query parameter and it is optional.
Method
GET
Notes
Given HTTP URL is called only by GET method and it is not configurable by parameters.
Badge responses are cached during 5 minutes. So, even if the given HTTP URL returns different result, you will get the same badge response during 5 minutes (if the link has the same message expression and label parameters)
Example
The following example gets the latest version of the OpenTelemetry AWS Lambda Collector layer from Github releases:
Creates badge HTTP config from given options in the path parameter and request body. Then returns created config id and Globadge API URL to be invoked with GET request to generate the badge from saved config.
expressionType (*): The type of the expression to be used while resolving badge message from HTTP URL response by message expression. Currently, only jq expressions are supported. This parameter is passed as pathparameter and it is mandatory.
httpConfigId (*): Id (in UUID v4 format) of the created badge HTTP config here. This parameter is passed as pathparameter and it is mandatory.
Method
GET
Notes
Given HTTP URL is called only by GET method and it is not configurable by parameters.
Badge responses are cached during 5 minutes. So, even if the given HTTP URL returns different result, you will get the same badge response during 5 minutes.
Example
The following example shows the latest version of the OpenTelemetry AWS Lambda Collector layer from Github releases:
{
// [Mandatory] HTTP URL to be invoked with GET request to get response
"httpURL": "<HTTP-URL>",
// [Optional] HTTP headers in string typed key/value format
"httpHeaders": {
"<HEADER-1>": "<HEADER-1-VALUE>",
...
"<HEADER-N>": "<HEADER-N-VALUE>",
},
// [Mandatory] Label of the badge
"label": "<LABEL>",
// [Mandatory] The expression to be used for resolving badge message from the response of the HTTP URL
"messageExpression": "<MESSAGE-EXPRESSION>"
}
{
// Id (in UUID v4 format) of the created badge HTTP config
"id": "<HTTP-CONFIG-ID>",
// Globadge API URL to be invoked with GET request to generate badge from saved config
// "<EXPRESSION-TYPE>" represent the value passed in the request path parameters for the expression type
// "<HTTP-CONFIG-ID>" represents the created config id which is returned in the "id" field in this response (above).
"url": "https://api.globadge.com/v1/badge/http/<EXPRESSION-TYPE>/<HTTP-CONFIG-ID>"
}