Update Resources-Session.md
Removed unimplemented features and updated response content.
This commit is contained in:
@ -1,8 +1,8 @@
|
|||||||
# Session Resource
|
# Session Resource
|
||||||
|
|
||||||
A session consists of a client connection, any number of related backend
|
A session is an abstraction of a client connection, any number of related backend
|
||||||
connections, a router module session and possibly filter module sessions. Each
|
connections, a router module session and possibly filter module sessions. Each
|
||||||
session is created on a service and a service can have multiple sessions.
|
session is created on a service and each service can have multiple sessions.
|
||||||
|
|
||||||
## Resource Operations
|
## Resource Operations
|
||||||
|
|
||||||
@ -16,23 +16,43 @@ GET /sessions/:id
|
|||||||
|
|
||||||
#### Response
|
#### Response
|
||||||
|
|
||||||
```
|
`Status: 200 OK`
|
||||||
Status: 200 OK
|
|
||||||
|
|
||||||
|
```javascript
|
||||||
{
|
{
|
||||||
"id": 1,
|
"links": {
|
||||||
"state": "Session ready for routing",
|
"self": "http://localhost:8989/v1/sessions/1"
|
||||||
"user": "jdoe",
|
},
|
||||||
"address": "192.168.0.200",
|
"data": {
|
||||||
"service": "/services/my-service",
|
"id": "1",
|
||||||
"connected": "Wed Aug 31 03:03:12 2016",
|
"type": "sessions",
|
||||||
"idle": 260
|
"relationships": {
|
||||||
|
"services": {
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/services/"
|
||||||
|
},
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"id": "RW-Split-Router",
|
||||||
|
"type": "services"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"attributes": {
|
||||||
|
"state": "Listener Session",
|
||||||
|
"connected": "Wed May 17 10:06:35 2017"
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/sessions/1"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Supported Request Parameter
|
#### Supported Request Parameter
|
||||||
|
|
||||||
- `fields`
|
- `pretty`
|
||||||
|
|
||||||
### Get all sessions
|
### Get all sessions
|
||||||
|
|
||||||
@ -44,95 +64,90 @@ GET /sessions
|
|||||||
|
|
||||||
#### Response
|
#### Response
|
||||||
|
|
||||||
```
|
`Status: 200 OK`
|
||||||
Status: 200 OK
|
|
||||||
|
|
||||||
[
|
```javascript
|
||||||
{
|
{
|
||||||
"id": 1,
|
"links": {
|
||||||
"state": "Session ready for routing",
|
"self": "http://localhost:8989/v1/sessions/"
|
||||||
"user": "jdoe",
|
|
||||||
"address": "192.168.0.200",
|
|
||||||
"service": "/services/My-Service",
|
|
||||||
"connected": "Wed Aug 31 03:03:12 2016",
|
|
||||||
"idle": 260
|
|
||||||
},
|
},
|
||||||
{
|
"data": [
|
||||||
"id": 2,
|
{
|
||||||
"state": "Session ready for routing",
|
"id": "1",
|
||||||
"user": "dba",
|
"type": "sessions",
|
||||||
"address": "192.168.0.201",
|
"relationships": {
|
||||||
"service": "/services/My-Service",
|
"services": {
|
||||||
"connected": "Wed Aug 31 03:10:00 2016",
|
"links": {
|
||||||
"idle": 1
|
"self": "http://localhost:8989/v1/services/"
|
||||||
}
|
},
|
||||||
]
|
"data": [
|
||||||
|
{
|
||||||
|
"id": "RW-Split-Router",
|
||||||
|
"type": "services"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"attributes": {
|
||||||
|
"state": "Listener Session",
|
||||||
|
"connected": "Wed May 17 10:06:35 2017"
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/sessions/1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "2",
|
||||||
|
"type": "sessions",
|
||||||
|
"relationships": {
|
||||||
|
"services": {
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/services/"
|
||||||
|
},
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"id": "Read-Connection-Router",
|
||||||
|
"type": "services"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"attributes": {
|
||||||
|
"state": "Listener Session",
|
||||||
|
"connected": "Wed May 17 10:06:35 2017"
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/sessions/2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3",
|
||||||
|
"type": "sessions",
|
||||||
|
"relationships": {
|
||||||
|
"services": {
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/services/"
|
||||||
|
},
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"id": "CLI",
|
||||||
|
"type": "services"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"attributes": {
|
||||||
|
"state": "Listener Session",
|
||||||
|
"connected": "Wed May 17 10:06:35 2017"
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/sessions/3"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Supported Request Parameter
|
#### Supported Request Parameter
|
||||||
|
|
||||||
- `fields`
|
- `pretty`
|
||||||
- `range`
|
|
||||||
|
|
||||||
### Get all connections created by a session
|
|
||||||
|
|
||||||
Get all backend connections created by a session. _:id_ must be a valid session ID.
|
|
||||||
|
|
||||||
```
|
|
||||||
GET /sessions/:id/connections
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Response
|
|
||||||
|
|
||||||
```
|
|
||||||
Status: 200 OK
|
|
||||||
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"state": "DCB in the polling loop",
|
|
||||||
"role": "Backend Request Handler",
|
|
||||||
"server": "/servers/db-serv-01",
|
|
||||||
"service": "/services/my-service",
|
|
||||||
"statistics": {
|
|
||||||
"reads": 2197
|
|
||||||
"writes": 1562
|
|
||||||
"buffered_writes": 0
|
|
||||||
"high_water_events": 0
|
|
||||||
"low_water_events": 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"state": "DCB in the polling loop",
|
|
||||||
"role": "Backend Request Handler",
|
|
||||||
"server": "/servers/db-serv-02",
|
|
||||||
"service": "/services/my-service",
|
|
||||||
"statistics": {
|
|
||||||
"reads": 0
|
|
||||||
"writes": 0
|
|
||||||
"buffered_writes": 0
|
|
||||||
"high_water_events": 0
|
|
||||||
"low_water_events": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Supported Request Parameter
|
|
||||||
|
|
||||||
- `fields`
|
|
||||||
- `range`
|
|
||||||
|
|
||||||
### Close a session
|
|
||||||
|
|
||||||
Close a session. This will forcefully close the client connection and any
|
|
||||||
backend connections.
|
|
||||||
|
|
||||||
```
|
|
||||||
DELETE /sessions/:id
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Response
|
|
||||||
|
|
||||||
```
|
|
||||||
Status: 204 No Content
|
|
||||||
```
|
|
||||||
|
Reference in New Issue
Block a user