Skip to content

Commit

Permalink
Fix bug while list capabilties
Browse files Browse the repository at this point in the history
Different from other list commands, listcapabilities does not return an array list.

```
(localcloud) 🐱 > list capabilities
{
  "capability": {
    "allowusercreateprojects": true,
    "allowuserexpungerecovervm": true,
    "allowuserexpungerecovervolume": true,
    "allowuserviewalldomainaccounts": false,
    "allowuserviewdestroyedvm": true,
    "cloudstackversion": "4.15.0.0",
    "customdiskofferingmaxsize": 1024,
    "customdiskofferingminsize": 1,
    "dynamicrolesenabled": true,
    "kubernetesclusterexperimentalfeaturesenabled": false,
    "kubernetesserviceenabled": true,
    "kvmsnapshotenabled": true,
    "projectinviterequired": false,
    "regionsecondaryenabled": false,
    "securitygroupsenabled": false,
    "supportELB": "false",
    "userpublictemplateenabled": true
  }
}
```

for other list apis, e.g. list templates
```
(localcloud) 🐱 > list templates templatefilter=all filter=id,name
{
  "count": 2,
  "template": [
    {
      "id": "b54e8a17-ebe5-4849-a015-2698e1d01768",
      "name": "SystemVM Template (KVM)"
    },
    {
      "id": "63985306-48ee-11eb-8680-069fc4003392",
      "name": "CentOS 5.5(64-bit) no GUI (KVM)"
    }
  ]
}
```
  • Loading branch information
ustcweizhou committed Jan 5, 2021
1 parent bc6cdc7 commit 7be6828
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cloudstack/ConfigurationService.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ func (s *ConfigurationService) ListCapabilities(p *ListCapabilitiesParams) (*Lis
}

type ListCapabilitiesResponse struct {
Count int `json:"count"`
Capabilities []*Capability `json:"capability"`
Capabilities *Capability `json:"capability"`
}

type Capability struct {
Expand Down

0 comments on commit 7be6828

Please sign in to comment.