HTTP - script API
StackState Self-hosted v5.1.x
Last updated
StackState Self-hosted v5.1.x
Last updated
Sometimes it may be useful to process the retrieved topology or telemetry data using an external tool. For example, to perform analysis using a custom Python script, a cloud service or a Machine Learning framework. StackState can call out to any external service via HTTP using the functions in this script API.
HTTP.get(uri: String)
Submit HTTP get request.
uri
- uri of the HTTP server.
.timeout(time: Duration)
- make the request timeout after has elapsed.
.param(name: String, value: String)
- specify the query.
.header(name: String, value: String)
- specify the header.
.noProxy()
- even when a proxy is configured don't use it for this request.
Async: HttpScriptApiTextResponse or HttpScriptApiJsonResponse if .jsonResponse()
is used.
HTTP.put(uri: String)
Submit HTTP put request.
uri
- uri of the HTTP server.
.param(name: String, value: String)
- specify the query.
.header(name: String, value: String)
- specify the header.
.noProxy()
- even when a proxy is configured don't use it for this request.
.contentType(contentType: String)
- specify the content type, for example "application/text".
.textRequest(text: String)
- specify the text of the request.
.jsonBody()
- get the body of the JSON response.
.jsonResponse()
- get the JSON response.
AsyncScriptResult[HttpScriptApiTextResponse]
or AsyncScriptResult[HttpScriptApiJsonResponse]
if .jsonResponse()
is used.
HTTP.post(uri: String)
Submit HTTP post request.
uri
- uri of the HTTP server.
.param(name: String, value: String)
- specify the query.
.header(name: String, value: String)
- specify the header.
.noProxy()
- even when a proxy is configured don't use it for this request.
.contentType(contentType: String)
- specify the content type, for example "application/text".
.textRequest(text: String)
- specify the text of the request.
.jsonBody()
- get the body of the JSON response.
.jsonResponse()
- get the JSON response.
AsyncScriptResult[HttpScriptApiTextResponse]
or AsyncScriptResult[HttpScriptApiJsonResponse]
if .jsonResponse()
is used.
HTTP.delete(uri: String)
Submit HTTP delete request.
uri
- uri of the HTTP server.
.param(name: String, value: String)
- specify the query.
.header(name: String, value: String)
- specify the header.
.noProxy()
- even when a proxy is configured don't use it for this request.
AsyncScriptResult[HttpScriptApiTextResponse]
or AsyncScriptResult[HttpScriptApiJsonResponse]
if .jsonResponse()
is used.
HTTP.options(uri: String)
Submit HTTP options request.
uri
- uri of the HTTP server.
HTTP.patch(uri: String)
Submit HTTP patch request.
uri
- uri of the HTTP server.
.param(name: String, value: String)
- specify the query.
.header(name: String, value: String)
- specify the header.
.noProxy()
- even when a proxy is configured don't use it for this request.
.contentType(contentType: String)
- specify the content type, for example "application/text".
.textRequest(text: String)
- specify the text of the request.
.jsonBody()
- get the body of the JSON response.
.jsonResponse()
- get the JSON response.
AsyncScriptResult[HttpScriptApiTextResponse]
or AsyncScriptResult[HttpScriptApiJsonResponse]
if .jsonResponse()
is used.
HTTP.head(uri: String)
Submit HTTP head request.
uri
- uri of the HTTP server.
.param(name: String, value: String)
- specify the query.
.noProxy()
- even when a proxy is configured don't use it for this request.
.header(name: String, value: String)
- specify the header.
AsyncScriptResult[HttpScriptApiTextResponse]
or AsyncScriptResult[HttpScriptApiJsonResponse]
if .jsonResponse()
is used.
.timeout(time: Duration)
- make the request timeout after has elapsed.
.jsonRequest(json: Goovy.lang.Closures)
- specify the JSON of the request. This will wrap the given closure with a .
.timeout(time: Duration)
- make the request timeout after has elapsed.
.jsonRequest(json: Goovy.lang.Closures)
- specify the JSON of the request. This will wrap the given closure with a .
.timeout(time: Duration)
- make the request timeout after has elapsed.
.timeout(time: Duration)
- make the request timeout after has elapsed.
.jsonRequest(json: Goovy.lang.Closures)
- specify the JSON of the request. This will wrap the given closure with a .
.timeout(time: Duration)
- make the request timeout after has elapsed.