-
Notifications
You must be signed in to change notification settings - Fork 172
Expand file tree
/
Copy pathapicast-policy.json
More file actions
122 lines (122 loc) · 3.17 KB
/
Copy pathapicast-policy.json
File metadata and controls
122 lines (122 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Maintenance Mode",
"summary": "Rejects incoming requests. Useful for maintenance periods.",
"description": [
"A policy which allows you to reject incoming requests with a specified status code and message. ",
"It's useful for maintenance periods or to temporarily block an API. \n",
"It allows to select a list of Upstream URLs for which to enable the maintenance mode."
],
"version": "builtin",
"configuration": {
"definitions": {
"operation": {
"type": "object",
"properties": {
"left": {
"type": "string"
},
"op": {
"description": "Operation to apply. The matches op supports PCRE (Perl compatible regular expressions)",
"type": "string",
"enum": [
"==",
"!=",
"matches"
]
},
"right": {
"type": "string"
},
"left_type": {
"description": "How to evaluate 'left'",
"type": "string",
"default": "plain",
"oneOf": [
{
"enum": [
"plain"
],
"title": "Evaluate 'left' as plain text."
},
{
"enum": [
"liquid"
],
"title": "Evaluate 'left' as liquid."
}
]
},
"right_type": {
"description": "How to evaluate 'right'",
"type": "string",
"default": "plain",
"oneOf": [
{
"enum": [
"plain"
],
"title": "Evaluate 'right' as plain text."
},
{
"enum": [
"liquid"
],
"title": "Evaluate 'right' as liquid."
}
]
}
},
"required": [
"left",
"op",
"right"
]
}
},
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "HTTP status code to return",
"default": 503
},
"message": {
"type": "string",
"description": "HTTP response to return",
"default": "Service Unavailable - Maintenance"
},
"message_content_type": {
"type": "string",
"description": "Content-Type header for the response",
"default": "text/plain; charset=utf-8"
},
"condition": {
"type": "object",
"title": "Condition",
"required": [
"combine_op",
"operations"
],
"properties": {
"combine_op": {
"title": "Combine operation",
"type": "string",
"default": "and",
"enum": [
"and",
"or"
]
},
"operations": {
"type": "array",
"items": {
"$ref": "#/definitions/operation"
},
"minItems": 1
}
}
}
}
}
}