-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,820 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# ESPv2 Configurations | ||
|
||
This directory contains examples of how to configure ESPv2. | ||
|
||
## Service Control | ||
|
||
Includes how to configure Authorization by API Key, and Quota, controlled by ServiceControl filter. | ||
|
||
* [Producer defined OpenAPI Specification](/service_control/openapi_swagger.json) | ||
|
||
* [Google Cloud Endpoints generated Service configuration]( | ||
/service_control/service_config_generated.json | ||
): Service configuration generated by ServiceManagement Service. | ||
Can be accessible by running: | ||
|
||
``` | ||
gcloud endpoints configs describe "${CONFIG_ID}" --project="${PROJECT}" \ | ||
--service="${SERVICE}" --format=json > service.json | ||
``` | ||
|
||
* [ESPv2 generated Envoy configuration]( | ||
/service_control/envoy_config.json | ||
): Equivalent Envoy static Bootstrap configuration. | ||
|
||
## Dynamic Routing(TBD) | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"description": "A simple Google Cloud Endpoints Bookstore API example.", | ||
"title": "Bookstore", | ||
"version": "1.0.0" | ||
}, | ||
"host": "bookstore.endpoints.apiproxy-231719.cloud.goog", | ||
"basePath": "/", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"schemes": [ | ||
"https" | ||
], | ||
"paths": { | ||
"/shelves": { | ||
"get": { | ||
"description": "Returns all shelves in the bookstore.", | ||
"operationId": "listShelves", | ||
"produces": [ | ||
"application/json" | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "List of shelves in the bookstore.", | ||
"schema": { | ||
"$ref": "#/definitions/listShelvesResponse" | ||
} | ||
} | ||
}, | ||
"x-google-quota": { | ||
"metricCosts": { | ||
"read-requests": 1 | ||
} | ||
}, | ||
"security": [] | ||
}, | ||
"post": { | ||
"description": "Creates a new shelf in the bookstore.", | ||
"operationId": "createShelf", | ||
"parameters": [ | ||
{ | ||
"description": "A shelf resource to create.", | ||
"in": "body", | ||
"name": "shelf", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/shelf" | ||
} | ||
} | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "A newly created shelf resource.", | ||
"schema": { | ||
"$ref": "#/definitions/shelf" | ||
} | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"api_key": [] | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"shelf": { | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"theme": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"name", | ||
"theme" | ||
] | ||
} | ||
}, | ||
"securityDefinitions": { | ||
"api_key": { | ||
"in": "query", | ||
"name": "key", | ||
"type": "apiKey" | ||
} | ||
}, | ||
"x-google-management": { | ||
"metrics": [ | ||
{ | ||
"name": "read-requests", | ||
"displayName": "Read requests", | ||
"value_type": "INT64", | ||
"metric_kind": "DELTA" | ||
} | ||
], | ||
"quota": { | ||
"limits": [ | ||
{ | ||
"name": "read-limit", | ||
"metric": "read-requests", | ||
"unit": "1/min/{project}", | ||
"values": { | ||
"STANDARD": 1000 | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.