You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
decort-golang-sdk/pkg/cloudbroker/pcidevice/list.go

27 lines
442 B

package pcidevice
import (
"context"
"encoding/json"
"net/http"
)
// List gets list all pci devices
func (p PCIDevice) List(ctx context.Context) (ListPCIDevices, error) {
url := "/cloudbroker/pcidevice/list"
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, nil)
if err != nil {
return nil, err
}
list := ListPCIDevices{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return list, nil
}