This commit is contained in:
2023-07-26 13:32:39 +03:00
parent f731cf246f
commit 272e385318
167 changed files with 5194 additions and 890 deletions

View File

@@ -42,9 +42,9 @@ import (
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/flattens"
)
func flattenPcideviceList(pl pcidevice.ListPCIDevices) []map[string]interface{} {
func flattenPcideviceList(pl *pcidevice.ListPCIDevices) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
for _, item := range pl {
for _, item := range pl.Data {
temp := map[string]interface{}{
"ckey": item.CKey,
"meta": flattens.FlattenMeta(item.Meta),

View File

@@ -53,7 +53,7 @@ func utilityPcideviceCheckPresence(ctx context.Context, d *schema.ResourceData,
pcideviceId = id
}
for _, pd := range pcideviceList {
for _, pd := range pcideviceList.Data {
if pd.ID == pcideviceId {
return &pd, nil
}

View File

@@ -38,10 +38,12 @@ import (
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
)
func utilityPcideviceListCheckPresence(ctx context.Context, m interface{}) (pcidevice.ListPCIDevices, error) {
func utilityPcideviceListCheckPresence(ctx context.Context, m interface{}) (*pcidevice.ListPCIDevices, error) {
c := m.(*controller.ControllerCfg)
pcideviceList, err := c.CloudBroker().PCIDevice().List(ctx)
req := pcidevice.ListRequest{}
pcideviceList, err := c.CloudBroker().PCIDevice().List(ctx, req)
if err != nil {
return nil, err
}