Hello Friends,
I am close on having a simple kvm proxy to write my google service account api key, but it wont take. I can confirm my gcp-kvm map exists through the Apigee Management API with:
GET https://apigee.googleapis.com/v1/organizations/myproject/environments/eval/keyvaluemaps/
However, my KVM PUT operation doesn't set the value like it should. I have tinkered around with it, and I just need another set of eyes to help me finish the last pixel that is off.
My curl command is
curl -X POST -k -H "Authorization: Bearer xyxyxyxyxyxyxyxyxyxyxyxyxyx" https://myproject-eval.apigee.net/gcp-kvm-admin -d "private_key=yxyxyxyxyxyxyxyxyxyxyxyxyxyxyxy"
it returns 200 with a payload:
{"requested" : yxyxyxyxyxyxyxyxyxyxyxyxyxyxyxy, "message" : "success", "private_key": }
so I know request.fromparam.private_key is being read, and I have traced it and the value seems to be there.
my proxies are attached. I am used a sharedflow for the GET operation so I can use it from other proxies that need access to this value.
Thanks so much for your support . It truly is invaluable.
Solved! Go to Solution.
ok I see a couple problems.
In your sharedflowbundle/sharedflows/default.xml , there is no step. It looks like this:
<SharedFlow name="default"></SharedFlow>
I think you need to add a step, like this:
<SharedFlow name="default"> <Step> <Name>KVM-GET-GCP-KEY</Name> </Step> </SharedFlow>
Maybe most importantly, in apiproxy/policies/PUT-GCP-API-KEY.xml, on line 11, the
ref=
attribute uses curly braces. It shouldn't. You have:
<Value ref="{request.formparam.private_key}"/>
You should have:
<Value ref="request.formparam.private_key"/>
Please find attached a working version of your proxy and sharedflow.
ok I see a couple problems.
In your sharedflowbundle/sharedflows/default.xml , there is no step. It looks like this:
<SharedFlow name="default"></SharedFlow>
I think you need to add a step, like this:
<SharedFlow name="default"> <Step> <Name>KVM-GET-GCP-KEY</Name> </Step> </SharedFlow>
Maybe most importantly, in apiproxy/policies/PUT-GCP-API-KEY.xml, on line 11, the
ref=
attribute uses curly braces. It shouldn't. You have:
<Value ref="{request.formparam.private_key}"/>
You should have:
<Value ref="request.formparam.private_key"/>
Please find attached a working version of your proxy and sharedflow.
Thanks so much Dino for the help. Also thanks for the advise on Apigee naming conventions and for taking the liberty of renaming the policies. I will edit my other proxies the best I can to keep the code more readable by other (Apigeesters?) who may need to work on them down the road.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |