apigee / apigee/apigeetool-node

ApigeeTool is failing with non-cps orgs but passing in CPS orgs

Open
#114 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
91
Forks
91
PR merge metrics
No merged PRs in 30d

Description

Edge Cloud

I am able to recreate the issue

Error: KeyValueMap Operation CreateKeyValueMapEntry is not supported for the organization <org_name>

[CAN YOU REPRODUCE IN A TEST ORG?]
YES

[STEPS TO REPRODUCE]
Here is the snapshot. Where it passed are all CPS orgs and where it failed are non-CPS


phanim-macbookpro:~ phanim$ apigeetool addEntryToKVM -u -o <org_name_1> -e dev --mapName kvmap --entryName test1 --entryValue value1
Password: *********
Error: KeyValueMap Operation CreateKeyValueMapEntry is not supported for the organization <org_name>

phanim-macbookpro:~ phanim$ apigeetool addEntryToKVM -u -o <org_name_2> -e test --mapName testKVM --entryName phani_test_1 --entryValue value1
Password: *********
Error: KeyValueMap Operation CreateKeyValueMapEntry is not supported for the organization <org_name_2>

phanim-macbookpro:~ phanim$ apigeetool addEntryToKVM -u -o <org_name_3> -e test --mapName test --entryName phani_test_1 --entryValue value1
Password: *********
{"name":"phani_test_1","value":"value1"}

phanim-macbookpro:~ phanim$ apigeetool addEntryToKVM -u -o <org_name_4> -e test --mapName test --entryName phani_test_1 --entryValue value1
Password: *********
{"name":"phani_test_1","value":"value1"}

phanim-macbookpro:~ phanim$ apigeetool addEntryToKVM -u -o <org_name_5> -e stage --mapName test --entryName phani_test_1 --entryValue value1
Password: *********
Error: KeyValueMap Operation CreateKeyValueMapEntry is not supported for the organization <org_name_5>


[ADDITIONAL DETAILS, LINKS TO LOGS, DUMPS, SCREENSHOTS, ETC]

I think, the apigeeTool is using CPS based API

Just looked into Apigee Tool code
https://github.com/apigee/apigeetool-node/blob/master/lib/commands/addEntryToKVM.js

The request URL that is being formed is
uri = util.format('%s/v1/o/%s/e/%s/keyvaluemaps/%s/entries', opts.baseuri, opts.organization, opts.environment, opts.mapName);

It is a CPS request so fails in non-CPS

Do we fix code in ApigeeTool?

CPS API :
https://apidocs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/keyvaluemaps/%7Bmap_name%7D/entries

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/commands/addEntryToKVM.js and inspect the request URL used by addEntryToKVM. Reproduce the commands in the issue against CPS and non-CPS organizations, then compare the generated request with the linked management API documentation. Done means the command creates entries in supported organization types without regressing existing CPS behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.