4.1.0
This commit is contained in:
107
internal/service/cloudapi/flipgroup/flattens.go
Normal file
107
internal/service/cloudapi/flipgroup/flattens.go
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
Copyright (c) 2019-2022 Digital Energy Cloud Solutions LLC. All Rights Reserved.
|
||||
Authors:
|
||||
Petr Krutov, <petr.krutov@digitalenergy.online>
|
||||
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
||||
Kasim Baybikov, <kmbaybikov@basistech.ru>
|
||||
Tim Tkachev, <tvtkachev@basistech.ru>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
|
||||
Orchestration Technology) with Terraform by Hashicorp.
|
||||
|
||||
Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
|
||||
|
||||
Please see README.md to learn where to place source code so that it
|
||||
builds seamlessly.
|
||||
|
||||
Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
||||
*/
|
||||
|
||||
package flipgroup
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/flipgroup"
|
||||
)
|
||||
|
||||
func flattenFlipgroup(d *schema.ResourceData, fg *flipgroup.ItemFLIPGroup) {
|
||||
d.Set("account_id", fg.AccountID)
|
||||
d.Set("account_name", fg.AccountName)
|
||||
d.Set("client_ids", fg.ClientIDs)
|
||||
d.Set("client_names", fg.ClientNames)
|
||||
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)
|
||||
d.Set("flipgroup_id", fg.ID)
|
||||
d.Set("ip", fg.IP)
|
||||
d.Set("milestones", fg.Milestones)
|
||||
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 {
|
||||
temp := map[string]interface{}{
|
||||
"account_id": fg.AccountID,
|
||||
"account_name": fg.AccountName,
|
||||
"client_ids": fg.ClientIDs,
|
||||
"client_names": fg.ClientNames,
|
||||
"client_type": fg.ClientType,
|
||||
"conn_id": fg.ConnID,
|
||||
"conn_type": fg.ConnType,
|
||||
"created_by": fg.CreatedBy,
|
||||
"created_time": fg.CreatedTime,
|
||||
"default_gw": fg.DefaultGW,
|
||||
"deleted_by": fg.DeletedBy,
|
||||
"deleted_time": fg.DeletedTime,
|
||||
"desc": fg.Description,
|
||||
"gid": fg.GID,
|
||||
"guid": fg.GUID,
|
||||
"flipgroup_id": fg.ID,
|
||||
"ip": fg.IP,
|
||||
"milestones": fg.Milestones,
|
||||
"name": fg.Name,
|
||||
"net_id": fg.NetID,
|
||||
"net_type": fg.NetType,
|
||||
"network": fg.Network,
|
||||
"rg_id": fg.RGID,
|
||||
"rg_name": fg.RGName,
|
||||
"status": fg.Status,
|
||||
"updated_by": fg.UpdatedBy,
|
||||
"updated_time": fg.UpdatedTime,
|
||||
}
|
||||
res = append(res, temp)
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user