This commit is contained in:
2023-12-19 16:37:50 +03:00
parent 20050bc169
commit f49d9f8860
150 changed files with 12582 additions and 11709 deletions

View File

@@ -36,15 +36,21 @@ package flipgroup
import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/flipgroup"
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/flattens"
)
func flattenFlipgroup(d *schema.ResourceData, fg *flipgroup.RecordFLIPGroup) {
d.Set("account_id", fg.AccountID)
d.Set("account_name", fg.AccountName)
d.Set("client_ids", fg.ClientIDs)
d.Set("client_type", fg.ClientType)
d.Set("conn_id", fg.ConnID)
d.Set("conn_type", fg.ConnType)
d.Set("created_by", fg.CreatedBy)
d.Set("created_time", fg.CreatedTime)
d.Set("default_gw", fg.DefaultGW)
d.Set("deleted_by", fg.DeletedBy)
d.Set("deleted_time", fg.DeletedTime)
d.Set("desc", fg.Description)
d.Set("gid", fg.GID)
d.Set("guid", fg.GUID)
@@ -54,13 +60,20 @@ func flattenFlipgroup(d *schema.ResourceData, fg *flipgroup.RecordFLIPGroup) {
d.Set("name", fg.Name)
d.Set("net_id", fg.NetID)
d.Set("net_type", fg.NetType)
d.Set("network", fg.Network)
d.Set("rg_id", fg.RGID)
d.Set("rg_name", fg.RGName)
d.Set("status", fg.Status)
d.Set("updated_by", fg.UpdatedBy)
d.Set("updated_time", fg.UpdatedTime)
}
func flattenFlipgroupList(fg_list *flipgroup.ListFLIPGroups) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
for _, fg := range fg_list.Data {
temp := map[string]interface{}{
"ckey": fg.CKey,
"meta": flattens.FlattenMeta(fg.Meta),
"account_id": fg.AccountID,
"client_ids": fg.ClientIDs,
"client_type": fg.ClientType,
@@ -76,6 +89,7 @@ func flattenFlipgroupList(fg_list *flipgroup.ListFLIPGroups) []map[string]interf
"name": fg.Name,
"net_id": fg.NetID,
"net_type": fg.NetType,
"net_mask": fg.NetMask,
"status": fg.Status,
}
res = append(res, temp)