Cannot create a runtime instance

I’ve gone through all the steps in creating a docker runtime instance, but am getting an error on the final step/PUT and not sure how it reflects what I have in the payload.

Here’s my call:

curl -b konnect_cookie -d @payload.json -X PUT --url https://cloud.konghq.com/api/runtime_groups/$MY_RUNTIME_GROUP_ID

My payload.json is formatted like this:

{"name":"default","certificates":["$MY_CERTIFICATE"],"id":"$MY_RUNTIME_GROUP_ID"}

And this is the response I get (no runtime instance created):

{                     
  "message": [                                                                                                                                
    {                                                                                                                                               "property": "id",                                                                                                                       
      "children": [], 
      "constraints": {
        "isUuid": "id must be a UUID"
      }                                                                                                                                       
    },                
    {                 
      "property": "name",
      "children": [],                                                  
      "constraints": {
        "isLength": "name must be longer than or equal to 2 characters",
        "isString": "name must be a string"
      }
    }
  ]
}

Any help on why this isn’t working would be greatly appreciated.

Keith

Hi Keith,

We don’t (yet!) have publicly documented/exposed APIs for the Konnect platform, but I think the API endpoint you are using is wrong. Try with https://us.api.konghq.com/konnect-api/api/runtime_groups/$MY_RUNTIME_GROUP_ID

I just tested with Insomnia and was able to create certificates through that API. Note: we don’t have an API yet for listing the certificates.

{
  "name": "default",
  "id": "$MY_RUNTIME_GROUP_ID",
  "certificates": [
    "-----BEGIN CERTIFICATE{THISISMYCERT}-----END CERTIFICATE-----\r\n"
  ],
  "metadata": {}
}

Best,
Ross

Hi Ross, thanks for the response.

I updated my call to reflect your endpoint and payload (ie. metadata) suggestions. I’m still getting this response:

{
  "message": [
    {
      "property": "id",
      "children": [],
      "constraints": {
        "isUuid": "id must be a UUID"
      }
    },
    {
      "property": "name",
      "children": [],
      "constraints": {
        "isLength": "name must be longer than or equal to 2 characters",
        "isString": "name must be a string"
      }
    }
  ]
}

It seems like it doesn’t like something with my payload formatting, but it is just like the one I put in the OP, but with ‘“,metadata”: {}’ added to the end of it. All other calls (auth and get runtime group id, etc) work, except this last one to PUT the certs.

Hi Keith,

Sorry you’re still seeing that! Probably time to share next level of details offline. There should be a HTTP header in the response (x-datadog-trace-id) - if you could send that traceid to my email (firstname {AT} konghq.com) with the runtime group ID, I can work with engineering to review the logs and see what’s going on.

Thanks,
Ross

Sounds good. I’ll send you an email. Thanks a lot.

Just for anyone else who comes across this thread: The key was to add -H 'Content-Type: application/json' to the curl command. Our API rejects any requests that do not explicitly specify the content type as json.

Thanks, Ross. Very helpful.