Skip to content

Commit

Permalink
avoid s2i-builder errors
Browse files Browse the repository at this point in the history
  • Loading branch information
y-tabata committed Apr 20, 2018
1 parent b362cd4 commit 8588974
Showing 1 changed file with 109 additions and 57 deletions.
166 changes: 109 additions & 57 deletions gateway/src/apicast/policy/rate_limit/apicast-policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,44 @@
"description": "List of limiters to be applied",
"type": "array",
"items": {
"oneOf": [{
"anyOf": [{
"type": "object",
"properties": {
"name": {
"type": "string",
"enum": ["connections"],
"description": "Limiting request concurrency (or concurrent connections)"
},
"$ref": "#/definitions/key",
"key": {
"description": "The key corresponding to the limiter object",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the key, must be unique in the scope"
},
"scope": {
"type": "string",
"description": "Scope of the key",
"default": "global",
"oneOf": [{
"enum": ["global"],
"description": "Global scope, affecting to all services"
}, {
"enum": ["service"],
"description": "Service scope, affecting to one service"
}]
},
"service_name": {
"type": "string",
"description": "Name of service, necessary for service scope"
}
}
},
"conn": {
"type": "integer",
"description": "The maximum number of concurrent requests allowed",
"minimum": 0,
"exclusiveMinimum": true
"exclusiveminimum": 0
},
"burst": {
"type": "integer",
Expand All @@ -34,8 +58,7 @@
"delay": {
"type": "number",
"description": "The default processing latency of a typical connection (or request)",
"minimum": 0,
"exclusiveMinimum": true
"exclusiveMinimum": 0
}
}
}, {
Expand All @@ -46,12 +69,36 @@
"enum": ["leaky_bucket"],
"description": "Limiting request rate"
},
"$ref": "#/definitions/key",
"key": {
"description": "The key corresponding to the limiter object",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the key, must be unique in the scope"
},
"scope": {
"type": "string",
"description": "Scope of the key",
"default": "global",
"oneOf": [{
"enum": ["global"],
"description": "Global scope, affecting to all services"
}, {
"enum": ["service"],
"description": "Service scope, affecting to one service"
}]
},
"service_name": {
"type": "string",
"description": "Name of service, necessary for service scope"
}
}
},
"rate": {
"type": "integer",
"description": "The specified request rate (number per second) threshold",
"minimum": 0,
"exclusiveMinimum": true
"exclusiveMinimum": 0
},
"burst": {
"type": "integer",
Expand All @@ -67,18 +114,41 @@
"enum": ["fixed_window"],
"description": "Limiting request counts"
},
"$ref": "#/definitions/key",
"key": {
"description": "The key corresponding to the limiter object",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the key, must be unique in the scope"
},
"scope": {
"type": "string",
"description": "Scope of the key",
"default": "global",
"oneOf": [{
"enum": ["global"],
"description": "Global scope, affecting to all services"
}, {
"enum": ["service"],
"description": "Service scope, affecting to one service"
}]
},
"service_name": {
"type": "string",
"description": "Name of service, necessary for service scope"
}
}
},
"count": {
"type": "integer",
"description": "The specified number of requests threshold",
"minimum": 0,
"exclusiveMinimum": true
"exclusiveMinimum": 0
},
"window": {
"type": "integer",
"description": "The time window in seconds before the request count is reset",
"minimum": 0,
"exclusiveMinimum": true
"exclusiveMinimum": 0
}
}
}]
Expand All @@ -92,7 +162,7 @@
"description": "List of error settings",
"type": "array",
"items": {
"oneOf": [{
"anyOf": [{
"type": "object",
"properties": {
"type": {
Expand All @@ -105,7 +175,18 @@
"description": "The status code when requests over the limit",
"default": 429
},
"$ref": "#/definitions/error_handling"
"error_handling": {
"type": "string",
"description": "How to handle an error",
"default": "exit",
"oneOf": [{
"enum": ["exit"],
"description": "Respond with an error"
}, {
"enum": ["log"],
"description": "Let the request go through and only output logs"
}]
}
}
}, {
"type": "object",
Expand All @@ -120,51 +201,22 @@
"description": "The status code when there is some configuration issue",
"default": 500
},
"$ref": "#/definitions/error_handling"
"error_handling": {
"type": "string",
"description": "How to handle an error",
"default": "exit",
"oneOf": [{
"enum": ["exit"],
"description": "Respond with an error"
}, {
"enum": ["log"],
"description": "Let the request go through and only output logs"
}]
}
}
}]
}
}
},
"definitions": {
"key": {
"description": "The key corresponding to the limiter object",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the key, must be unique in the scope"
},
"scope": {
"type": "string",
"description": "Scope of the key",
"default": "global",
"oneOf": [{
"enum": ["global"],
"description": "Global scope, affecting to all services"
}, {
"enum": ["service"],
"description": "Service scope, affecting to one service"
}]
},
"service_name": {
"type": "string",
"description": "Name of service, necessary for service scope"
}
}
},
"error_handling": {
"type": "string",
"description": "How to handle an error",
"default": "exit",
"oneOf": [{
"enum": ["exit"],
"description": "Respond with an error"
}, {
"enum": ["log"],
"description": "Let the request go through and only output logs"
}]
}
}
}
}

0 comments on commit 8588974

Please sign in to comment.