Update Resources-Filter.md
Updated filter resource documentation with up-to-date request output.
This commit is contained in:
parent
56cf06ee08
commit
e7a6aec010
@ -8,7 +8,7 @@ services can use the same filter and a single service can use multiple filters.
|
||||
### Get a filter
|
||||
|
||||
Get a single filter. The _:name_ in the URI must be a valid filter name with all
|
||||
whitespace replaced with hyphens. The filter names are case-insensitive.
|
||||
whitespace replaced with hyphens. The filter names are case-sensitive.
|
||||
|
||||
```
|
||||
GET /filters/:name
|
||||
@ -16,32 +16,38 @@ GET /filters/:name
|
||||
|
||||
#### Response
|
||||
|
||||
```
|
||||
Status: 200 OK
|
||||
`Status: 200 OK`
|
||||
|
||||
```javascript
|
||||
{
|
||||
"name": "Query Logging Filter",
|
||||
"module": "qlafilter",
|
||||
"parameters": {
|
||||
"filebase": {
|
||||
"value": "/var/log/maxscale/qla/log.",
|
||||
"configurable": false
|
||||
},
|
||||
"match": {
|
||||
"value": "select.*from.*t1",
|
||||
"configurable": true
|
||||
}
|
||||
"links": {
|
||||
"self": "http://localhost:8989/v1/filters/Hint-Filter"
|
||||
},
|
||||
"services": [
|
||||
"/services/my-service",
|
||||
"/services/my-second-service"
|
||||
]
|
||||
"data": {
|
||||
"id": "Hint-Filter",
|
||||
"type": "filters",
|
||||
"relationships": {
|
||||
"services": { // All serices that use this filter
|
||||
"links": {
|
||||
"self": "http://localhost:8989/v1/services/"
|
||||
},
|
||||
"data": [] // No service is using this filter
|
||||
}
|
||||
},
|
||||
"attributes": {
|
||||
"module": "hintfilter",
|
||||
"parameters": {} // Filter parameters
|
||||
},
|
||||
"links": {
|
||||
"self": "http://localhost:8989/v1/filters/Hint-Filter"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Supported Request Parameter
|
||||
|
||||
- `fields`
|
||||
- `pretty`
|
||||
|
||||
### Get all filters
|
||||
|
||||
@ -53,99 +59,37 @@ GET /filters
|
||||
|
||||
#### Response
|
||||
|
||||
```
|
||||
Status: 200 OK
|
||||
`Status: 200 OK`
|
||||
|
||||
[
|
||||
{
|
||||
"name": "Query Logging Filter",
|
||||
"module": "qlafilter",
|
||||
"parameters": {
|
||||
"filebase": {
|
||||
"value": "/var/log/maxscale/qla/log.",
|
||||
"configurable": false
|
||||
},
|
||||
"match": {
|
||||
"value": "select.*from.*t1",
|
||||
"configurable": true
|
||||
}
|
||||
},
|
||||
"services": [
|
||||
"/services/my-service",
|
||||
"/services/my-second-service
|
||||
]
|
||||
```javascript
|
||||
{
|
||||
"links": {
|
||||
"self": "http://localhost:8989/v1/filters/"
|
||||
},
|
||||
{
|
||||
"name": "DBFW Filter",
|
||||
"module": "dbfwfilter",
|
||||
"parameters": {
|
||||
{
|
||||
"name": "rules",
|
||||
"value": "/etc/maxscale-rules",
|
||||
"configurable": false
|
||||
"data": [ // Array of filter resources
|
||||
{
|
||||
"id": "Hint-Filter",
|
||||
"type": "filters",
|
||||
"relationships": {
|
||||
"services": {
|
||||
"links": {
|
||||
"self": "http://localhost:8989/v1/services/"
|
||||
},
|
||||
"data": []
|
||||
}
|
||||
},
|
||||
"attributes": {
|
||||
"module": "hintfilter",
|
||||
"parameters": {}
|
||||
},
|
||||
"links": {
|
||||
"self": "http://localhost:8989/v1/filters/Hint-Filter"
|
||||
}
|
||||
},
|
||||
"services": [
|
||||
"/services/my-second-service
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Supported Request Parameter
|
||||
|
||||
- `fields`
|
||||
- `range`
|
||||
|
||||
### Update a filter
|
||||
|
||||
**Note**: The update mechanisms described here are provisional and most likely
|
||||
will change in the future. This description is only for design purposes and
|
||||
does not yet work.
|
||||
|
||||
Partially update a filter. The _:name_ in the URI must map to a filter name
|
||||
and the request body must be a valid JSON Patch document which is applied to the
|
||||
resource.
|
||||
|
||||
```
|
||||
PATCH /filter/:name
|
||||
```
|
||||
|
||||
### Modifiable Fields
|
||||
|
||||
|Field |Type |Description |
|
||||
|------------|-------|---------------------------------|
|
||||
|parameters |object |Module specific filter parameters|
|
||||
|
||||
```
|
||||
[
|
||||
{ "op": "replace", "path": "/parameters/rules/value", "value": "/etc/new-rules" },
|
||||
{ "op": "add", "path": "/parameters/action/value", "value": "allow" }
|
||||
]
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
Response contains the modified resource.
|
||||
|
||||
```
|
||||
Status: 200 OK
|
||||
|
||||
{
|
||||
"name": "DBFW Filter",
|
||||
"module": "dbfwfilter",
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"value": "/etc/new-rules",
|
||||
"configurable": false
|
||||
},
|
||||
"action": {
|
||||
"value": "allow",
|
||||
"configurable": true
|
||||
}
|
||||
}
|
||||
"services": [
|
||||
"/services/my-second-service"
|
||||
]
|
||||
}
|
||||
```
|
||||
- `pretty`
|
||||
|
Loading…
x
Reference in New Issue
Block a user