New route added for 'Control API' for retrieving route info
This commit is contained in:
@@ -339,6 +339,34 @@ Removes the route identified by `:id`.
|
|||||||
* **Notes**:
|
* **Notes**:
|
||||||
|
|
||||||
|
|
||||||
|
#### Retrieve route information
|
||||||
|
|
||||||
|
Retrieves the information about the route identified by `:id`.
|
||||||
|
|
||||||
|
* **URL**: `/routes/:id`
|
||||||
|
* **Method**: `GET`
|
||||||
|
* **Success Responses**:
|
||||||
|
* **Code**: `200 OK`<br />
|
||||||
|
**Content**:<br />
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"method": "GET",
|
||||||
|
"url_pattern": "/hello",
|
||||||
|
"entrypoint": null,
|
||||||
|
"command": "echo Hello World | response /body",
|
||||||
|
"index": 0,
|
||||||
|
"id": "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
* **Error Responses**:
|
||||||
|
* **Code**: `404 Not Found`
|
||||||
|
* **Sample Call**:<br />
|
||||||
|
```sh
|
||||||
|
$ curl -X GET $KAPOW_URL/routes/ROUTE_1f186c92_f906_4506_9788_a1f541b11d0f
|
||||||
|
```
|
||||||
|
* **Notes**:
|
||||||
|
|
||||||
|
|
||||||
# HTTP Data API
|
# HTTP Data API
|
||||||
|
|
||||||
It is the channel through which the actual HTTP data flows during the
|
It is the channel through which the actual HTTP data flows during the
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
Feature: Fail to retrieve a route info in Kapow! server.
|
||||||
|
When trying to get a route info in the server, if it
|
||||||
|
does no exists the server respons with an error.
|
||||||
|
|
||||||
|
Scenario: Try to get info for a non-existing route.
|
||||||
|
A request of retrieving a non-existing route info
|
||||||
|
will trigger a not found error.
|
||||||
|
|
||||||
|
Given I have a just started Kapow! server
|
||||||
|
When I get the info for route with id "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx"
|
||||||
|
Then I get 404 as response code
|
||||||
|
And I get "Not Found" as response reason phrase
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
Feature: Retrieve route info in Kapow! server.
|
||||||
|
Users can retrieve route info from the server by
|
||||||
|
specifying its id.
|
||||||
|
|
||||||
|
Scenario: Retrieve route info.
|
||||||
|
Get route info by spscifying its id.
|
||||||
|
|
||||||
|
Given I have a Kapow! server whith the following routes:
|
||||||
|
| method | url_pattern | entrypoint | command |
|
||||||
|
| GET | /listRootDir | /bin/sh -c | ls -la / \| response /body |
|
||||||
|
| GET | /listDir/{dirname} | /bin/sh -c | ls -la /request/params/dirname \| response /body |
|
||||||
|
When I get the first route info
|
||||||
|
Then I get 200 as response code
|
||||||
|
And I get "OK" as response reason phrase
|
||||||
|
And I get the following response body:
|
||||||
|
"""
|
||||||
|
{
|
||||||
|
"method": "GET",
|
||||||
|
"url_pattern": "/listRootDir",
|
||||||
|
"entrypoint": "/bin/sh -c",
|
||||||
|
"command": "ls -la / | response /body",
|
||||||
|
"index": 0,
|
||||||
|
"id": ANY
|
||||||
|
}
|
||||||
|
"""
|
||||||
Reference in New Issue
Block a user