bf2fc6cc711aee1a0c2a/kas-fleet-manager

GetInstanceTypesByCloudProviderAndRegion doesn't seem to call proper API

wtrocki opened this issue · 6 comments

Our client for golang and JS failing on calling our new API after generating API spec.

{"id":"7","kind":"Error","href":"/api/kafkas_mgmt/v1/errors/7","code":"KAFKAS-MGMT-7","reason":"The requested resource '/api/kafkas_mgmt/v1/instance_types/' doesn't exist"}

Is the endpoint valid? Looks like openapi issue

Is the endpoint valid?

Yes, the endpoint is valid. I think the parameters are not being sent: it has to be /api/kafkas_mgmt/v1/instance_types/{cloud-provider}/{cloud-region}

ocm get /api/kafkas_mgmt/v1/instance_types/aws/us-east-1         
{
  "instance_types": [
    {
      "id": "developer",
      "display_name": "Trial",
      "sizes": [
        {
          "id": "x1",
          "ingress_throughput_per_sec": {
            "bytes": 1048576
          },
          "egress_throughput_per_sec": {
            "bytes": 1048576
          },
          "total_max_connections": 100,
          "max_data_retention_size": {
            "bytes": 10737418000
          },
          "max_partitions": 100,
          "max_data_retention_period": "P14D",
          "max_connection_attempts_per_sec": 50,
          "quota_consumed": 1,
          "quota_type": "RHOSAKTrial",
          "capacity_consumed": 1
        }
      ]
    },
    {
      "id": "standard",
      "display_name": "Standard",
      "sizes": [
        {
          "id": "x1",
          "ingress_throughput_per_sec": {
            "bytes": 52428800
          },
          "egress_throughput_per_sec": {
            "bytes": 104857600
          },
          "total_max_connections": 3000,
          "max_data_retention_size": {
            "bytes": 1073741800000
          },
          "max_partitions": 1500,
          "max_data_retention_period": "P14D",
          "max_connection_attempts_per_sec": 100,
          "quota_consumed": 1,
          "quota_type": "RHOSAK",
          "capacity_consumed": 1
        },
        {
          "id": "x2",
          "ingress_throughput_per_sec": {
            "bytes": 104857600
          },
          "egress_throughput_per_sec": {
            "bytes": 209715200
          },
          "total_max_connections": 6000,
          "max_data_retention_size": {
            "bytes": 2147483600000
          },
          "max_partitions": 3000,
          "max_data_retention_period": "P14D",
          "max_connection_attempts_per_sec": 200,
          "quota_consumed": 2,
          "quota_type": "RHOSAK",
          "capacity_consumed": 2
        }
      ]
    }
  ]
}

Ah. Parameters are in the uri instead of arguments. Will take look then

Both fields are marked as required however would it be possible to improve message to the users/validate those on server?

Both fields are marked as required however would it be possible to improve message to the users/validate those on server?

The field are marked as required in the OpenAPI spec, do you think the description can be improved there?

..improve message to the users/validate those on server?

Or you are thinking of instead of returning 404 the API server will say, missing 400 cloud-provider/cloud-region parameters?

I checked code. This is juice not worth squeeze. Basically clients should validate those.