apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.09k stars 1.11k forks source link

addTrafficType/listTrafficTypes fields #7837

Open poddm opened 1 year ago

poddm commented 1 year ago
ISSUE TYPE
COMPONENT NAME
API
CLOUDSTACK VERSION
4.17.2
CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

Enhance listTrafficTypes or add a new API (getTrafficType?) to return all fields used in addTrafficType.

Currently, there is no API to return fields for terraform to manage this resource. The various networks labels (eg. kvmnetworklabel) are inaccessible.

STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
boring-cyborg[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the issue template!

poddm commented 1 year ago

I do see network labels set but they aren't documented in ListApis.

{
    "listtraffictypesresponse": {
        "count": 2,
        "traffictype": [
            {
                "id": "0ffa5dd7-12a1-4ac0-b37f-e85a3b90ac9a",
                "traffictype": "Management",
                "physicalnetworkid": "05fcfaee-1504-4f8e-b77a-34669e78372a",
                "kvmnetworklabel": "123"
            },
DaanHoogland commented 1 year ago

@poddm to be clear on this; you want the request parameters from https://cloudstack.apache.org/api/apidocs-4.18/apis/addTrafficType.html to be added to the respons parameters of listTrafficTypes ?

poddm commented 1 year ago

@poddm to be clear on this; you want the request parameters from https://cloudstack.apache.org/api/apidocs-4.18/apis/addTrafficType.html to be added to the respons parameters of listTrafficTypes ?

Yup -

rohityadavcloud commented 1 year ago

To make it clear, the list API current returns this:

> list traffictypes physicalnetworkid=6a20338e-f16f-4333-a96f-2d110888d016
{
  "count": 2,
  "traffictype": [
    {
      "id": "8d785d45-c198-45b7-a857-1bddccb6e3bf",
      "kvmnetworklabel": "cloudbr0",
      "physicalnetworkid": "6a20338e-f16f-4333-a96f-2d110888d016",
      "traffictype": "Guest"
    },
    {
      "id": "9f6bf8c0-f834-46e6-9edf-bdeb22e00629",
      "kvmnetworklabel": "cloudbr0",
      "physicalnetworkid": "6a20338e-f16f-4333-a96f-2d110888d016",
      "traffictype": "Public"
    }
  ]
}

The issue/task is to add the following fields in response of the above API (that are request parameters of the add API https://cloudstack.apache.org/api/apidocs-4.18/apis/addTrafficType.html)

If the following are returned already when specified, then they may be skipped:

poddm commented 1 year ago

Ultimately, we would like to manage more of cloudstack with terraform. The mismatch between addTrafficType and listTrafficType is preventing me from enhancing the terraform provider.

madhukar93 commented 1 year ago

@rohityadavcloud taking this up.

madhukar93 commented 1 year ago

@DaanHoogland I see that the 14.8.2 milestone is added for this enhancement. Does this have any bearing on the base branch or should I develop against main?

DaanHoogland commented 1 year ago

@DaanHoogland I see that the 14.8.2 milestone is added for this enhancement. Does this have any bearing on the base branch or should I develop against main?

It is mostly your choice, but in case of new features we usually do main and in case of bug fixes/improvements that don't involve DB changes we usually take the latest release branch (or an older one if applicable). I this case you could even develop against 4.17 as that is what the user reports, and we can after development merge the fix forward. One thing to consider there is; the older the branch the bigger the conflict resolution effort will be.

Just tell us and I can adjust the milestone accordingly.

madhukar93 commented 1 year ago

I have gone with main for the sake of simplicity.