Hi,

listAPI response in general gives all the parameters present in the 
corresponding resource respond object (In this case it is DomainResponse).

For listDomainChildren API, only few response parameters are set in the 
DomainResponse. This can be improved by generating the response using database 
views.

You can later call listDomain API to list all the parameters. Also please feel 
free to create a new improvement ticket 
https://github.com/apache/cloudstack/issues/new for this.

Thanks,
Harikrishna

From: R A <jarhe...@hotmail.de>
Date: Thursday, 19 September 2024 at 9:04 AM
To: users@cloudstack.apache.org <users@cloudstack.apache.org>
Subject: listApis does not match with specific responds
Hi guys,

when i call

http://XXXXX:8080/client/api?command=listDomainChildren&response=json

then I will get many fields. These fields are also mentioned in the cloudstack 
api documentation.

But calling the listDomainChildren Endpoint results in a much fewer set of 
fields.

I am logged in as the root admin.

Can someone explain why there is such a big mismatch?

http://XXXXX:8080/client/api?command=listDomainChildren&response=json

{
    "listdomainchildrenresponse": {
        "count": 3,
        "domain": [
            {
                "id": "ac64fb70-1490-4705-8591-539b17b7b8df",
                "name": "testdomain2",
                "level": 1,
                "parentdomainid": "6170bb3d-439f-11ef-9de9-000babff3656",
                "parentdomainname": "ROOT",
                "haschild": false,
                "networkdomain": "testdomain.local",
                "path": "ROOT/testdomain2",
                "created": "2024-07-17T15:41:40+0200",
                "secondarystoragetotal": 0.0
            },
            {
                "id": "f95d8676-8158-4aca-87fd-998e9ada35e3",
                "name": "cloud",
                "level": 1,
                "parentdomainid": "6170bb3d-439f-11ef-9de9-000babff3656",
                "parentdomainname": "ROOT",
                "haschild": true,
                "path": "ROOT/cloud",
                "created": "2024-07-20T02:47:02+0200",
                "secondarystoragetotal": 0.0
            },
            {
                "id": "6b68b473-f6aa-4ce6-9acb-53e62c1355d4",
                "name": "domeahmed",
                "level": 1,
                "parentdomainid": "6170bb3d-439f-11ef-9de9-000babff3656",
                "parentdomainname": "ROOT",
                "haschild": false,
                "path": "ROOT/domeahmed",
                "created": "2024-07-30T16:55:57+0200",
                "secondarystoragetotal": 0.0
            }
        ]
    }
}




And this is what listApis does provide for listDomainChildren

http://XXXXXX:8080/client/api?command=listApis&name=listDomainChildren&response=json

{
    "listapisresponse": {
        "count": 1,
        "api": [
            {
                "name": "listDomainChildren",
                "description": "Lists all children domains belonging to a 
specified domain",
                "isasync": false,
                "related": "listDomains",
                "params": [
                    {
                        "name": "showicon",
                        "description": "flag to display the resource icon for 
domains",
                        "type": "boolean",
                        "length": 255,
                        "required": false
                    },
                    {
                        "name": "id",
                        "description": "list children domain by parent domain 
ID.",
                        "type": "uuid",
                        "length": 255,
                        "required": false,
                        "related": "listDomainChildren,listDomains"
                    },
                    {
                        "name": "keyword",
                        "description": "List by keyword",
                        "type": "string",
                        "length": 255,
                        "required": false
                    },
                    {
                        "name": "isrecursive",
                        "description": "to return the entire tree, use the 
value \"true\". To return the first level children, use the value \"false\".",
                        "type": "boolean",
                        "length": 255,
                        "required": false
                    },
                    {
                        "name": "listall",
                        "description": "If set to false, list only resources 
belonging to the command's caller; if set to true - list resources that the 
caller is authorized to see. Default value is false",
                        "type": "boolean",
                        "length": 255,
                        "required": false
                    },
                    {
                        "name": "page",
                        "description": "",
                        "type": "integer",
                        "length": 255,
                        "required": false
                    },
                    {
                        "name": "name",
                        "description": "list children domains by name",
                        "type": "string",
                        "length": 255,
                        "required": false
                    },
                    {
                        "name": "pagesize",
                        "description": "",
                        "type": "integer",
                        "length": 255,
                        "required": false
                    }
                ],
                "response": [
                    {
                        "name": "primarystoragetotal",
                        "description": "the total primary storage space (in 
GiB) owned by domain",
                        "type": "long"
                    },
                    {
                        "name": "projectavailable",
                        "description": "the total number of projects available 
for administration by this domain",
                        "type": "string"
                    },
                    {
                        "name": "vpcavailable",
                        "description": "the total number of vpcs available to 
be created for this domain",
                        "type": "string"
                    },
                    {
                        "name": "primarystorageavailable",
                        "description": "the total primary storage space (in 
GiB) available to be used for this domain",
                        "type": "string"
                    },
                    {
                        "name": "vmlimit",
                        "description": "the total number of virtual machines 
that can be deployed by this domain",
                        "type": "string"
                    },
                    {
                        "name": "icon",
                        "description": "Base64 string representation of the 
resource icon",
                        "type": "resourceiconresponse"
                    },
                    {
                        "name": "state",
                        "description": "the state of the domain",
                        "type": "string"
                    },
                    {
                        "name": "ipavailable",
                        "description": "the total number of public ip addresses 
available for this domain to acquire",
                        "type": "string"
                    },
                    {
                        "name": "cpulimit",
                        "description": "the total number of cpu cores the 
domain can own",
                        "type": "string"
                    },
                    {
                        "name": "iplimit",
                        "description": "the total number of public ip addresses 
this domain can acquire",
                        "type": "string"
                    },
                    {
                        "name": "projectlimit",
                        "description": "the total number of projects the domain 
can own",
                        "type": "string"
                    },
                    {
                        "name": "id",
                        "description": "the ID of the domain",
                        "type": "string"
                    },
                    {
                        "name": "projecttotal",
                        "description": "the total number of projects being 
administrated by this domain",
                        "type": "long"
                    },
                    {
                        "name": "jobid",
                        "description": "the UUID of the latest async job acting 
on this object",
                        "type": "string"
                    },
                    {
                        "name": "snapshotlimit",
                        "description": "the total number of snapshots which can 
be stored by this domain",
                        "type": "string"
                    },
                    {
                        "name": "hasannotations",
                        "description": "true if the entity/resource has 
annotations",
                        "type": "boolean"
                    },
                    {
                        "name": "name",
                        "description": "the name of the domain",
                        "type": "string"
                    },
                    {
                        "name": "templatetotal",
                        "description": "the total number of templates which 
have been created by this domain",
                        "type": "long"
                    },
                    {
                        "name": "level",
                        "description": "the level of the domain",
                        "type": "integer"
                    },
                    {
                        "name": "memoryavailable",
                        "description": "the total memory (in MB) available to 
be created for this domain",
                        "type": "string"
                    },
                    {
                        "name": "memorytotal",
                        "description": "the total memory (in MB) owned by 
domain",
                        "type": "long"
                    },
                    {
                        "name": "domaindetails",
                        "description": "details for the domain",
                        "type": "map"
                    },
                    {
                        "name": "parentdomainname",
                        "description": "the domain name of the parent domain",
                        "type": "string"
                    },
                    {
                        "name": "snapshottotal",
                        "description": "the total number of snapshots stored by 
this domain",
                        "type": "long"
                    },
                    {
                        "name": "secondarystorageavailable",
                        "description": "the total secondary storage space (in 
GiB) available to be used for this domain",
                        "type": "string"
                    },
                    {
                        "name": "secondarystoragelimit",
                        "description": "the total secondary storage space (in 
GiB) the domain can own",
                        "type": "string"
                    },
                    {
                        "name": "vpclimit",
                        "description": "the total number of vpcs the domain can 
own",
                        "type": "string"
                    },
                    {
                        "name": "jobstatus",
                        "description": "the current status of the latest async 
job acting on this object",
                        "type": "integer"
                    },
                    {
                        "name": "networkdomain",
                        "description": "the network domain",
                        "type": "string"
                    },
                    {
                        "name": "iptotal",
                        "description": "the total number of public ip addresses 
allocated for this domain",
                        "type": "long"
                    },
                    {
                        "name": "parentdomainid",
                        "description": "the domain ID of the parent domain",
                        "type": "string"
                    },
                    {
                        "name": "created",
                        "description": "the date when this domain was created",
                        "type": "date"
                    },
                    {
                        "name": "templatelimit",
                        "description": "the total number of templates which can 
be created by this domain",
                        "type": "string"
                    },
                    {
                        "name": "vmavailable",
                        "description": "the total number of virtual machines 
available for this domain to acquire",
                        "type": "string"
                    },
                    {
                        "name": "cputotal",
                        "description": "the total number of cpu cores owned by 
domain",
                        "type": "long"
                    },
                    {
                        "name": "networktotal",
                        "description": "the total number of networks owned by 
domain",
                        "type": "long"
                    },
                    {
                        "name": "networkavailable",
                        "description": "the total number of networks available 
to be created for this domain",
                        "type": "string"
                    },
                    {
                        "name": "primarystoragelimit",
                        "description": "the total primary storage space (in 
GiB) the domain can own",
                        "type": "string"
                    },
                    {
                        "name": "volumeavailable",
                        "description": "the total volume available for this 
domain",
                        "type": "string"
                    },
                    {
                        "name": "path",
                        "description": "the path of the domain",
                        "type": "string"
                    },
                    {
                        "name": "memorylimit",
                        "description": "the total memory (in MB) the domain can 
own",
                        "type": "string"
                    },
                    {},
                    {
                        "name": "volumetotal",
                        "description": "the total volume being used by this 
domain",
                        "type": "long"
                    },
                    {
                        "name": "networklimit",
                        "description": "the total number of networks the domain 
can own",
                        "type": "string"
                    },
                    {},
                    {
                        "name": "haschild",
                        "description": "whether the domain has one or more 
sub-domains",
                        "type": "boolean"
                    },
                    {
                        "name": "vmtotal",
                        "description": "the total number of virtual machines 
deployed by this domain",
                        "type": "long"
                    },
                    {
                        "name": "secondarystoragetotal",
                        "description": "the total secondary storage space (in 
GiB) owned by domain",
                        "type": "float"
                    },
                    {
                        "name": "cpuavailable",
                        "description": "the total number of cpu cores available 
to be created for this domain",
                        "type": "string"
                    },
                    {
                        "name": "volumelimit",
                        "description": "the total volume which can be used by 
this domain",
                        "type": "string"
                    },
                    {
                        "name": "vpctotal",
                        "description": "the total number of vpcs owned by 
domain",
                        "type": "long"
                    },
                    {
                        "name": "snapshotavailable",
                        "description": "the total number of snapshots available 
for this domain",
                        "type": "string"
                    },
                    {
                        "name": "templateavailable",
                        "description": "the total number of templates available 
to be created by this domain",
                        "type": "string"
                    }
                ]
            }
        ]
    }
}


 

Reply via email to