emissary/misc/rest/server.rest

65 lines
1.2 KiB
ReStructuredText
Raw Normal View History

2023-02-02 10:55:24 +01:00
@baseUrl = http://localhost:3000
### Get agents
# @name getAgents
GET {{ baseUrl }}/api/v1/agents
Content-Type: application/json
@agentId = {{ getAgents.response.body.Data.Agents.0.ID }}
### Update an agent (accept it)
PUT {{ baseUrl }}/api/v1/agents/{{ agentId }}
Content-Type: application/json
{
"Status": 1
}
### Get an agent
GET {{ baseUrl }}/api/v1/agents/{{ agentId }}
Content-Type: application/json
### Get an agent specs
# @name getSpecs
GET {{ baseUrl }}/api/v1/agents/{{ agentId }}/specs
Content-Type: application/json
@specName = {{ getSpecs.response.body.Data.Specs.0.Name }}
### Update an agent specs
POST {{ baseUrl }}/api/v1/agents/{{ agentId }}/specs
Content-Type: application/json
{
"Name": "gateway.emissary.cadoles.com",
"Revision": 2,
"Data": {
"gateways": {
"cadoles.com":{
"address":":3003",
"target":"https://www.cadoles.com"
}
}
}
}
### Delete an agent spec
DELETE {{ baseUrl }}/api/v1/agents/{{ agentId }}/specs
Content-Type: application/json
{
"Name": "gateway.emissary.cadoles.com"
}
### Update UCI spec with uhttpd config
POST {{ baseUrl }}/api/v1/agents/2/specs
Content-Type: application/json
< ./uci-spec.payload.json