Skip to main content
Version: 1.15

Request-Response

Overview

Depending on your network topology after you deploy a Request-Response scenario, there should be either a k8s service or ingress resource allowing you to connect to the scenario.

When you use default source and sink, you can interact with REST API provided by before mentioned service or ingress with HTTP POST method.

Connection

In case of service you can trigger your scenario with example curl command:

curl -X POST -d "payload_based_on_input_schema" 'http://<scenario_name>'

For ingress configuration it looks quite similar:

curl -X POST -d "payload_based_on_input_schema" 'http://<ingress_domain><scenario_name>'

OpenAPI interface definition

For each deployed Request-Response scenario an OpenAPI interface definition will be available at http://<scenario_name>/definition

You can see example definition below:

Scenario OpenAPI definition
{
"openapi" : "3.1.0",
"info" : {
"title" : "dsw-rr",
"version" : "1"
},
"paths" : {
"/" : {
"post" : {
"description" : "**scenario name**: dsw-rr",
"tags" : [
"Nussknacker"
],
"requestBody" : {
"required" : true,
"content" : {
"application/json" : {
"schema" : {
"type" : "object",
"nullable" : false,
"properties" : {
"input" : {
"type" : "object",
"nullable" : false,
"required" : [
"first",
"last"
],
"properties" : {
"last" : {
"type" : "string",
"nullable" : false
},
"first" : {
"type" : "string",
"nullable" : false
}
}
}
}
}
}
}
},
"produces" : [
"application/json"
],
"consumes" : [
"application/json"
],
"summary" : "dsw-rr",
"responses" : {
"200" : {
"content" : {
"application/json" : {
"schema" : {
"type" : "object",
"properties" : {
"input" : {
"type" : "object",
"properties" : {
"first" : {
"type" : "string"
},
"last" : {
"type" : "string"
}
},
"required" : [
"first",
"last"
]
}
}
}
}
}
}
}
}
}
}
}