Apigee X API and KVM

Hello

I'm trying to use the recently release (2nd of June 2022) API to interact with environment KVM (and more precisely, KVM entries create)

Creating a KVM (and listing KVM) is workgin fine, not problem:

 

$ export TOKEN=$(gcloud auth print-access-token)

$ curl -H "Authorization: Bearer $TOKEN" \
   -X GET \
   "https://apigee.googleapis.com/v1/organizations/<myOrg>/environments/<myEnv>/keyvaluemaps"
[]

$ curl -H "Authorization: Bearer $TOKEN" \
   -X POST \
   "https://apigee.googleapis.com/v1/organizations/<myOrg>/environments/<myEnv>/keyvaluemaps" \ 
   -H "Content-Type: application/json" \
   -d '{"name":"KVM_Test", "encrypted":true}'
{
"name": "KVM_Test",
"encrypted": true
}

$ curl -H "Authorization: Bearer $TOKEN" \
   -X GET "https://apigee.googleapis.com/v1/organizations/<myOrg>/environments/<myEnv>/keyvaluemaps"
[
"KVM_Test"
]

 

Liste entries seems to work (empty KVM):

 

$ curl -H "Authorization: Bearer $TOKEN" -X GET \
   "https://apigee.googleapis.com/v1/organizations/<myOrg>/environments/<myEnv>/keyvaluemaps/KVM_Test/entries"
{
"keyValueEntries": [],
"nextPageToken": ""
}

 

However, I cannot list existing KEYS, nor to create  key:

 

$ curl -H "Authorization: Bearer $TOKEN" -X GET \
   "https://apigee.googleapis.com/v1/organizations/<myOrg>/environments/<myEnv>/keyvaluemaps/KV-Other-Test/entries"
{
	"error": {
		"code": 500,
		"message": "Invalid key length 64 for EnvKvmKey",
		"status": "INTERNAL",
		"details": [{
			"@type": "type.googleapis.com/google.rpc.PreconditionFailure",
			"violations": [{
				"subject": "[2002:a17:530:4b4c::]:4146:wdnf1:9842:570074:70547162",
				"description": "Invalid key length 64 for EnvKvmKey"
			}]
		}, {
			"@type": "type.googleapis.com/google.rpc.RequestInfo",
			"requestId": "3941513199778787966"
		}]
	}
}

$ curl -H "Authorization: Bearer $TOKEN" -X POST \
   "https://apigee.googleapis.com/v1/organizations/<myOrg>/environments/<myEnv>/keyvaluemaps/KVM_Test/entries" \
   -H "Content-Type: application/json" \
   -d '{"name":"keyName1", "value":"keyValue1"}'

{
	"error": {
		"code": 500,
		"message": "Error while encrypting for encrypted KeyValueMap KeyValueMapScope {ScopeType ='ENVIRONMENTS', Organization = '<myOrg>', Environment = '<myEnv>'}",
		"status": "INTERNAL",
		"details": [{
			"@type": "type.googleapis.com/google.rpc.PreconditionFailure",
			"violations": [{
				"type": "keyvaluemap.service.ErrorDuringEncryption",
				"subject": "[2002:a17:531:4b0a::]:4046:wdog3:9896:392908:78644714",
				"description": "Error while encrypting for encrypted KeyValueMap KeyValueMapScope {ScopeType ='ENVIRONMENTS', Organization = 'myOrg', Environment = 'myEnv'}"
			}]
		}, {
			"@type": "type.googleapis.com/google.rpc.RequestInfo",
			"requestId": "5068192461593099311"
		}]
	}
}

 

 

Does anyone know how to use these endpoints?

 

Thanks

Arnaduga

 

 

Solved Solved
0 8 672
1 ACCEPTED SOLUTION

Yes, that is what it means. 

View solution in original post

8 REPLIES 8

Can you confirm for me that you are using Apigee X?  Can you confirm that your runtime is not running Apigee hybrid? 

If you ARE using Apigee X, then I would like to diagnose this problem .  Can you Direct Message me here, (or email dchiesa@google)  sending me information on your Apigee X organization? 

Hello

Yes, it is on APIGEE X, an evaluation organization, provisionned in April/May.

I just performed the same test on a paid org, provisioned recently (10 days ago appr.) and it worked as expected. 😕

Does it mean the evaluation org are not up-to-date (which could make sense as they are temporary) as this API was release at the beginning of this month?

Arnaduga

Yes, that is what it means. 

Ok, thanks for the confirmation!

Hey, can you send me a DM here with the name of the organization?  or email it to me? 

(If you have emailed to me already, please confirm that and I Will check my spam folder)

I didn't, but I just did now (via email)!

Got it, thank you. 

Hi!

APIGEE Hybrid:

Do we have any update/solution for this issue. We are current getting same errors as mentioned in this post, while creating the 'KeyValueMap entries'.  We were able to create the 'keyValueMap' (map identifier name) encrypted=true. And can see the KVM from UI. 

 

Request:

curl --location --request POST 'https://apigee.googleapis.com/v1/organizations/apigee-hybrid-****-*******/environments/preprod/keyva... \
--header 'Authorization: Bearer *****************************************
' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "testkey",
  "value": "test123"
}'

 

Error:

{

    "error": {

        "code": 500,

        "message": "Error while encrypting for encrypted KeyValueMap KeyValueMapScope {ScopeType ='ENVIRONMENTS', Organization = 'apigee-hybrid-****-****, Environment = 'preprod'}",

        "status": "INTERNAL",

        "details": [

            {

                "@type": "type.googleapis.com/google.rpc.PreconditionFailure",

                "violations": [

                    {

                        "type": "keyvaluemap.service.ErrorDuringEncryption",

                        "subject": "[2002:a17:90a:d795::]:4496:smdm20:9805:225460:24744470",

                        "description": "Error while encrypting for encrypted KeyValueMap KeyValueMapScope {ScopeType ='ENVIRONMENTS', Organization = 'apigee-hybrid-****-****', Environment = 'preprod'}"

                    }

                ]

            },

            {

                "@type": "type.googleapis.com/google.rpc.RequestInfo",

                "requestId": "3746721517"

            }

        ]

    }

}

 

Please let me know your views. @dchiesa1