* openapi: update /filtering

This commit is contained in:
Simon Zolin 2019-09-06 17:19:04 +03:00
parent adb422fedf
commit 57bb04685f

View file

@ -438,34 +438,30 @@ paths:
# Filtering status methods # Filtering status methods
# -------------------------------------------------- # --------------------------------------------------
/filtering/status: /filtering_info:
get: get:
tags: tags:
- filtering - filtering
operationId: filteringStatus operationId: filteringInfo
summary: 'Get status of rules-based filter' summary: 'Get filtering parameters'
responses: responses:
200: 200:
description: OK description: OK
schema: schema:
$ref: "#/definitions/FilteringStatus" $ref: "#/definitions/FilterInfo"
/filtering/enable: /filtering_config:
post: post:
tags: tags:
- filtering - filtering
operationId: filteringEnable operationId: filteringConfig
summary: 'Enable filtering' summary: 'Set filtering parameters'
responses: parameters:
200: - in: "body"
description: OK name: "body"
required: true
/filtering/disable: schema:
post: $ref: "#/definitions/FilterConfig"
tags:
- filtering
operationId: filteringDisable
summary: 'Disable filtering'
responses: responses:
200: 200:
description: OK description: OK
@ -506,42 +502,19 @@ paths:
200: 200:
description: OK description: OK
/filtering/enable_url: /filtering/set_url:
post: post:
tags: tags:
- filtering - filtering
operationId: filteringEnableURL operationId: filteringSetURL
summary: 'Enable filter URL' summary: 'Set URL parameters'
consumes: consumes:
- text/plain - application/json
parameters: parameters:
- in: body - in: "body"
name: url name: "body"
description: 'Previously added URL containing filtering rules'
required: true
schema: schema:
type: string $ref: "#/definitions/FilterSetUrl"
example: 'url=https://filters.adtidy.org/windows/filters/15.txt'
responses:
200:
description: OK
/filtering/disable_url:
post:
tags:
- filtering
operationId: filteringDisableURL
summary: 'Disable filter URL'
consumes:
- text/plain
parameters:
- in: body
name: url
description: 'Previously added URL containing filtering rules'
required: true
schema:
type: string
example: 'url=https://filters.adtidy.org/windows/filters/15.txt'
responses: responses:
200: 200:
description: OK description: OK
@ -1051,7 +1024,7 @@ definitions:
lastUpdated: lastUpdated:
type: "string" type: "string"
format: "date-time" format: "date-time"
example: "2018-10-30T12:18:57.223101822+03:00" example: "2018-10-30T12:18:57+03:00"
name: name:
type: "string" type: "string"
example: "AdGuard Simplified Domain Names filter" example: "AdGuard Simplified Domain Names filter"
@ -1061,16 +1034,15 @@ definitions:
url: url:
type: "string" type: "string"
example: "https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt" example: "https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt"
FilteringStatus:
FilterInfo:
type: "object" type: "object"
description: "Filtering settings" description: "Filtering settings"
required:
- "enabled"
- "filters"
- "user_rules"
properties: properties:
enabled: enabled:
type: "boolean" type: "boolean"
interval:
type: "integer"
filters: filters:
type: "array" type: "array"
items: items:
@ -1079,9 +1051,25 @@ definitions:
type: "array" type: "array"
items: items:
type: "string" type: "string"
example:
- '||example.org^' FilterConfig:
- '||example.com^' type: "object"
description: "Filtering settings"
properties:
enabled:
type: "boolean"
interval:
type: "integer"
FilterSetUrl:
type: "object"
description: "Filtering URL settings"
properties:
url:
type: "string"
enabled:
type: "boolean"
GetVersionRequest: GetVersionRequest:
type: "object" type: "object"
description: "/version.json request data" description: "/version.json request data"