apigee

swagger tools error handler middleware not catching errors

冷暖自知 提交于 2019-12-03 12:41:19
overview My custom errorHandler middleware is not catching the swagger-tools request validator error. Instead, the swagger tools HTML error is sent back to the client. How can I get my errorHandler middleware to catch the swagger tools validation error and respond to the client accordingly? my prognosis I'm rather clueless unfortunately. No matter where I put the app.use(errorHandler) directive, the swagger tools html error is returned to the client and my errorHandler function never catches the error. Maybe I'm overlooking something overtly incorrect about my setup. Below is my app.js file

Quota counters : what makes them distinct? Are there additional filters on top of the Identifier field?

流过昼夜 提交于 2019-12-02 07:40:38
问题 Say within an API bundle, we have 3 different flows (e.g., flow A, flow B, and flow C), and they all reference the same Quota policy named QuotaLimitPolicy. Are they really using separate counters for a given Identifier? Flow A is executed -> QuotaLimitPolicy is executed. Result: "A counter" = 1 Flow B is executed -> QuotaLimitPolicy is executed. Result: "B counter" = 1 Flow A is executed -> QuotaLimitPolicy is executed. Result: "A counter" = 1 +1 = 2 Flow C is executed -> QuotaLimitPolicy is

Quota counters : what makes them distinct? Are there additional filters on top of the Identifier field?

纵饮孤独 提交于 2019-12-02 06:09:16
Say within an API bundle, we have 3 different flows (e.g., flow A, flow B, and flow C), and they all reference the same Quota policy named QuotaLimitPolicy. Are they really using separate counters for a given Identifier? Flow A is executed -> QuotaLimitPolicy is executed. Result: "A counter" = 1 Flow B is executed -> QuotaLimitPolicy is executed. Result: "B counter" = 1 Flow A is executed -> QuotaLimitPolicy is executed. Result: "A counter" = 1 +1 = 2 Flow C is executed -> QuotaLimitPolicy is executed. Result: "C counter" = 1 Flow A is executed -> QuotaLimitPolicy is executed. Result: "A

How to run a subprocess inside Google Cloud Function in Python

瘦欲@ 提交于 2019-12-01 22:16:32
问题 I'm trying to run a bash script inside GCP Function but somehow it's not working. Here my function, which basically export a file(proxy) to Google Apigee: def test2(request): cmd = "python ./my-proxy/tools/deploy.py -n myProxy -u userName:!password -o myOrg -e test -d ./my-proxy -p /" # no block, it start a sub process. p = subprocess.Popen(cmd , shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # and you can block util the cmd execute finish p.wait() # or stdout, stderr = p

One API proxy calling two different target endpoints

怎甘沉沦 提交于 2019-12-01 12:16:45
i have just started working with Apigee. I want to create one API proxy which will call two target endpoints based on 'if' condition. i have created an API and added resources to it but the problem is in this case i am getting two API's . If thetype='abc' target point should be target1 if thetype='xyz' target point should be target2 Can anyone please tell me how to proceed with it ? Mike Dunker Check out the answer to this question . The details of finding the RouteRules is listed there. The ProxyEndpoint documentation will also be helpful. You can accomplish what you are attempting using this

One API proxy calling two different target endpoints

假如想象 提交于 2019-12-01 11:29:35
问题 i have just started working with Apigee. I want to create one API proxy which will call two target endpoints based on 'if' condition. i have created an API and added resources to it but the problem is in this case i am getting two API's . If thetype='abc' target point should be target1 if thetype='xyz' target point should be target2 Can anyone please tell me how to proceed with it ? 回答1: Check out the answer to this question. The details of finding the RouteRules is listed there. The

Swagger:Issue with Path parameter

情到浓时终转凉″ 提交于 2019-11-29 00:58:57
I am try to create a swagger file with the following path: paths: /v1/customers/{id}/summary : However I get the following error right off bat: API requires path parameter but it is not defined: id at paths ▹ /v1/customers/{id}/summary It does not seem to like the 'id' parameter. Could anybody tell me how I could rectify this? If I drill down on this I see the following: Details Object swaggerError: Object errors: Array [1] 0: Object code: "MISSING_API_PATH_PARAMETER" message: "API requires path parameter but it is not defined: id" data: "/v1/customers/{id}/summary" path: Array [2] warnings:

Create a New Endpoint on an existing API Proxy with “No Target Endpoint”

為{幸葍}努か 提交于 2019-11-28 14:41:09
I have an existing apigee API proxy that has a default proxy endpoint and a default target endpoint that goes to our backend server. It has a rate-limiting (quota) policy in place and throws an error to the client when it exceeds its allotted (daily) quota. Everything's great and working as intended. Now I want to create a new proxy endpoint (or a new resource on the existing default proxy endpoint) on this same API proxy but routes to an "empty" target endpoint; I basically just want this new proxy call to return a JSON/JSONP about the caller's current quota status (basically display the

Swagger:Issue with Path parameter

≯℡__Kan透↙ 提交于 2019-11-27 15:30:03
问题 I am try to create a swagger file with the following path: paths: /v1/customers/{id}/summary : However I get the following error right off bat: API requires path parameter but it is not defined: id at paths ▹ /v1/customers/{id}/summary It does not seem to like the 'id' parameter. Could anybody tell me how I could rectify this? If I drill down on this I see the following: Details Object swaggerError: Object errors: Array [1] 0: Object code: "MISSING_API_PATH_PARAMETER" message: "API requires

Create a New Endpoint on an existing API Proxy with “No Target Endpoint”

一笑奈何 提交于 2019-11-27 08:48:41
问题 I have an existing apigee API proxy that has a default proxy endpoint and a default target endpoint that goes to our backend server. It has a rate-limiting (quota) policy in place and throws an error to the client when it exceeds its allotted (daily) quota. Everything's great and working as intended. Now I want to create a new proxy endpoint (or a new resource on the existing default proxy endpoint) on this same API proxy but routes to an "empty" target endpoint; I basically just want this