4.3.0
This commit is contained in:
175
internal/service/cloudapi/k8s/data_source_k8ci_list.go
Normal file
175
internal/service/cloudapi/k8s/data_source_k8ci_list.go
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
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 k8s
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants"
|
||||
)
|
||||
|
||||
func dataSourceK8CIListRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
list, err := utilityK8CIListCheckPresence(ctx, d, m)
|
||||
if err != nil {
|
||||
d.SetId("")
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
d.SetId(uuid.New().String())
|
||||
flattenK8CIList(d, list)
|
||||
d.Set("entry_count", list.EntryCount)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func dataSourceK8CIListSchemaMake() map[string]*schema.Schema {
|
||||
return map[string]*schema.Schema{
|
||||
"by_id": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Filter by ID",
|
||||
},
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Filter by name",
|
||||
},
|
||||
"status": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Filter by status",
|
||||
},
|
||||
"worker_driver": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Filter by worker driver",
|
||||
},
|
||||
"master_driver": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Filter by master driver",
|
||||
},
|
||||
"network_plugin": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Filter by network plugin",
|
||||
},
|
||||
"include_disabled": {
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Default: false,
|
||||
Description: "Include deleted k8cis in result",
|
||||
},
|
||||
"page": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Page number",
|
||||
},
|
||||
"size": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Page size",
|
||||
},
|
||||
"items": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"k8ci_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "K8CI ID",
|
||||
},
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Description: "K8CI name",
|
||||
},
|
||||
"lb_image_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "LB Image ID",
|
||||
},
|
||||
"network_plugins": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Description: "List of available network plugins",
|
||||
Elem: &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
},
|
||||
},
|
||||
"status": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Description: "K8CI Status",
|
||||
},
|
||||
"desc": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"created_time": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
"version": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"entry_count": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func DataSourceK8CIList() *schema.Resource {
|
||||
return &schema.Resource{
|
||||
SchemaVersion: 1,
|
||||
|
||||
ReadContext: dataSourceK8CIListRead,
|
||||
|
||||
Timeouts: &schema.ResourceTimeout{
|
||||
Read: &constants.Timeout30s,
|
||||
Default: &constants.Timeout60s,
|
||||
},
|
||||
|
||||
Schema: dataSourceK8CIListSchemaMake(),
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ 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.
|
||||
@@ -60,7 +61,7 @@ func dataSourceK8sRead(ctx context.Context, d *schema.ResourceData, m interface{
|
||||
}
|
||||
|
||||
curK8s := k8s.ItemK8SCluster{}
|
||||
for _, k8sCluster := range k8sList {
|
||||
for _, k8sCluster := range k8sList.Data {
|
||||
if k8sCluster.ID == cluster.ID {
|
||||
curK8s = k8sCluster
|
||||
}
|
||||
|
||||
@@ -135,6 +135,46 @@ func k8sWorkersGroupsSchemaMake() map[string]*schema.Schema {
|
||||
|
||||
func createK8sListSchema() map[string]*schema.Schema {
|
||||
return map[string]*schema.Schema{
|
||||
"by_id": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Filter by ID",
|
||||
},
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Filter by name",
|
||||
},
|
||||
"ip_address": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Filter by IP address",
|
||||
},
|
||||
"rg_id": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Filter by RG ID",
|
||||
},
|
||||
"lb_id": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Filter by LB ID",
|
||||
},
|
||||
"bservice_id": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Filter by BService ID",
|
||||
},
|
||||
"status": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Filter by status",
|
||||
},
|
||||
"tech_status": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Filter by tech. status",
|
||||
},
|
||||
"includedeleted": {
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
@@ -276,6 +316,10 @@ func createK8sListSchema() map[string]*schema.Schema {
|
||||
},
|
||||
},
|
||||
},
|
||||
"entry_count": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,9 +37,34 @@ import (
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/compute"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/k8ci"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/k8s"
|
||||
)
|
||||
|
||||
func flattenK8CIItems(list *k8ci.ListK8CI) []map[string]interface{} {
|
||||
res := make([]map[string]interface{}, 0)
|
||||
for _, item := range list.Data {
|
||||
temp := map[string]interface{}{
|
||||
"k8ci_id": item.ID,
|
||||
"name": item.Name,
|
||||
"lb_image_id": item.LBImageID,
|
||||
"network_plugins": item.NetworkPlugins,
|
||||
"status": item.Status,
|
||||
"desc": item.Description,
|
||||
"created_time": item.CreatedTime,
|
||||
"version": item.Version,
|
||||
}
|
||||
|
||||
res = append(res, temp)
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
func flattenK8CIList(d *schema.ResourceData, list *k8ci.ListK8CI) {
|
||||
d.Set("items", flattenK8CIItems(list))
|
||||
}
|
||||
|
||||
func flattenK8sDataComputes(d *schema.ResourceData, cluster *k8s.RecordK8S) {
|
||||
d.Set("k8s_id", cluster.ID)
|
||||
d.Set("masters", flattenMasterComputes(cluster))
|
||||
@@ -262,9 +287,9 @@ func flattenWorkersGroup(workersGroups k8s.ListK8SGroups) []map[string]interface
|
||||
return res
|
||||
}
|
||||
|
||||
func flattenK8sItems(k8sItems k8s.ListK8SClusters) []map[string]interface{} {
|
||||
func flattenK8sItems(k8sItems *k8s.ListK8SClusters) []map[string]interface{} {
|
||||
res := make([]map[string]interface{}, 0)
|
||||
for _, item := range k8sItems {
|
||||
for _, item := range k8sItems.Data {
|
||||
temp := map[string]interface{}{
|
||||
"account_id": item.AccountID,
|
||||
"account_name": item.Name,
|
||||
@@ -299,8 +324,9 @@ func flattenK8sItems(k8sItems k8s.ListK8SClusters) []map[string]interface{} {
|
||||
return res
|
||||
}
|
||||
|
||||
func flattenK8sList(d *schema.ResourceData, k8sItems k8s.ListK8SClusters) {
|
||||
func flattenK8sList(d *schema.ResourceData, k8sItems *k8s.ListK8SClusters) {
|
||||
d.Set("items", flattenK8sItems(k8sItems))
|
||||
d.Set("entry_count", k8sItems.EntryCount)
|
||||
}
|
||||
|
||||
func flattenResourceK8sCP(d *schema.ResourceData, k8s k8s.RecordK8S, masters []compute.RecordCompute) {
|
||||
|
||||
@@ -21,7 +21,7 @@ func existK8sID(ctx context.Context, d *schema.ResourceData, m interface{}) (boo
|
||||
return false, err
|
||||
}
|
||||
|
||||
return len(k8sList.FilterByID(k8sID)) != 0, nil
|
||||
return len(k8sList.FilterByID(k8sID).Data) != 0, nil
|
||||
}
|
||||
|
||||
func existK8sCIID(ctx context.Context, d *schema.ResourceData, m interface{}) (bool, error) {
|
||||
@@ -34,7 +34,7 @@ func existK8sCIID(ctx context.Context, d *schema.ResourceData, m interface{}) (b
|
||||
return false, err
|
||||
}
|
||||
|
||||
return len(k8sciList.FilterByID(k8sciID)) != 0, nil
|
||||
return len(k8sciList.FilterByID(k8sciID).Data) != 0, nil
|
||||
}
|
||||
|
||||
func existRGID(ctx context.Context, d *schema.ResourceData, m interface{}) (bool, error) {
|
||||
@@ -47,7 +47,7 @@ func existRGID(ctx context.Context, d *schema.ResourceData, m interface{}) (bool
|
||||
return false, err
|
||||
}
|
||||
|
||||
return len(rgList.FilterByID(rgID)) != 0, nil
|
||||
return len(rgList.FilterByID(rgID).Data) != 0, nil
|
||||
}
|
||||
|
||||
func existExtNetID(ctx context.Context, d *schema.ResourceData, m interface{}) (bool, error) {
|
||||
@@ -65,5 +65,5 @@ func existExtNetID(ctx context.Context, d *schema.ResourceData, m interface{}) (
|
||||
return false, err
|
||||
}
|
||||
|
||||
return len(extNetList.FilterByID(extNetID)) != 0, nil
|
||||
return len(extNetList.FilterByID(extNetID).Data) != 0, nil
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ func resourceK8sRead(ctx context.Context, d *schema.ResourceData, m interface{})
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
curK8s := k8s.ItemK8SCluster{}
|
||||
for _, k8sCluster := range k8sList {
|
||||
for _, k8sCluster := range k8sList.Data {
|
||||
if k8sCluster.ID == cluster.ID {
|
||||
curK8s = k8sCluster
|
||||
}
|
||||
@@ -299,17 +299,19 @@ func resourceK8sRead(ctx context.Context, d *schema.ResourceData, m interface{})
|
||||
|
||||
flattenResourceK8s(d, *cluster, masterComputeList, workersComputeList)
|
||||
|
||||
lbGetReq := lb.GetRequest{
|
||||
LBID: cluster.LBID,
|
||||
}
|
||||
if d.Get("with_lb").(bool) || cluster.LBID != 0 {
|
||||
lbGetReq := lb.GetRequest{
|
||||
LBID: cluster.LBID,
|
||||
}
|
||||
|
||||
lb, err := c.CloudAPI().LB().Get(ctx, lbGetReq)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
lb, err := c.CloudAPI().LB().Get(ctx, lbGetReq)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
d.Set("extnet_id", lb.ExtNetID)
|
||||
d.Set("lb_ip", lb.PrimaryNode.FrontendIP)
|
||||
d.Set("extnet_id", lb.ExtNetID)
|
||||
d.Set("lb_ip", lb.PrimaryNode.FrontendIP)
|
||||
}
|
||||
|
||||
kubeconfigReq := k8s.GetConfigRequest{
|
||||
K8SID: cluster.ID,
|
||||
|
||||
@@ -267,7 +267,7 @@ func resourceK8sCPRead(ctx context.Context, d *schema.ResourceData, m interface{
|
||||
}
|
||||
|
||||
curK8s := k8s.ItemK8SCluster{}
|
||||
for _, k8sCluster := range k8sList {
|
||||
for _, k8sCluster := range k8sList.Data {
|
||||
if k8sCluster.ID == cluster.ID {
|
||||
curK8s = k8sCluster
|
||||
}
|
||||
@@ -302,13 +302,15 @@ func resourceK8sCPRead(ctx context.Context, d *schema.ResourceData, m interface{
|
||||
LBID: cluster.LBID,
|
||||
}
|
||||
|
||||
lb, err := c.CloudAPI().LB().Get(ctx, lbGetReq)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
if d.Get("with_lb").(bool) || cluster.LBID != 0 {
|
||||
lb, err := c.CloudAPI().LB().Get(ctx, lbGetReq)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
d.Set("extnet_id", lb.ExtNetID)
|
||||
d.Set("lb_ip", lb.PrimaryNode.FrontendIP)
|
||||
d.Set("extnet_id", lb.ExtNetID)
|
||||
d.Set("lb_ip", lb.PrimaryNode.FrontendIP)
|
||||
}
|
||||
|
||||
kubeconfigReq := k8s.GetConfigRequest{
|
||||
K8SID: cluster.ID,
|
||||
|
||||
83
internal/service/cloudapi/k8s/utility_k8ci.go
Normal file
83
internal/service/cloudapi/k8s/utility_k8ci.go
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
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 k8s
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/k8ci"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
|
||||
)
|
||||
|
||||
func utilityK8CIListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*k8ci.ListK8CI, error) {
|
||||
c := m.(*controller.ControllerCfg)
|
||||
|
||||
req := k8ci.ListRequest{}
|
||||
|
||||
if by_id, ok := d.GetOk("by_id"); ok {
|
||||
req.ByID = uint64(by_id.(int))
|
||||
}
|
||||
if name, ok := d.GetOk("name"); ok {
|
||||
req.Name = name.(string)
|
||||
}
|
||||
if status, ok := d.GetOk("status"); ok {
|
||||
req.Status = status.(string)
|
||||
}
|
||||
if worker_driver, ok := d.GetOk("worker_driver"); ok {
|
||||
req.WorkerDriver = worker_driver.(string)
|
||||
}
|
||||
if master_driver, ok := d.GetOk("master_driver"); ok {
|
||||
req.MasterDriver = master_driver.(string)
|
||||
}
|
||||
if network_plugin, ok := d.GetOk("network_plugin"); ok {
|
||||
req.NetworkPlugins = network_plugin.(string)
|
||||
}
|
||||
if include_disabled, ok := d.GetOk("include_disabled"); ok {
|
||||
req.IncludeDisabled = include_disabled.(bool)
|
||||
}
|
||||
if page, ok := d.GetOk("page"); ok {
|
||||
req.Page = uint64(page.(int))
|
||||
}
|
||||
if size, ok := d.GetOk("size"); ok {
|
||||
req.Size = uint64(size.(int))
|
||||
}
|
||||
|
||||
resList, err := c.CloudAPI().K8CI().List(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resList, nil
|
||||
}
|
||||
@@ -223,12 +223,44 @@ func utilityDataK8sCheckPresence(ctx context.Context, d *schema.ResourceData, m
|
||||
return k8s, nil
|
||||
}
|
||||
|
||||
func utilityK8sListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (k8s.ListK8SClusters, error) {
|
||||
func utilityK8sListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*k8s.ListK8SClusters, error) {
|
||||
c := m.(*controller.ControllerCfg)
|
||||
req := k8s.ListRequest{
|
||||
IncludeDeleted: false,
|
||||
}
|
||||
|
||||
if by_id, ok := d.GetOk("by_id"); ok {
|
||||
req.ByID = uint64(by_id.(int))
|
||||
}
|
||||
|
||||
if name, ok := d.GetOk("name"); ok {
|
||||
req.Name = name.(string)
|
||||
}
|
||||
|
||||
if ip_address, ok := d.GetOk("ip_address"); ok {
|
||||
req.IPAddress = ip_address.(string)
|
||||
}
|
||||
|
||||
if rg_id, ok := d.GetOk("rg_id"); ok {
|
||||
req.RGID = uint64(rg_id.(int))
|
||||
}
|
||||
|
||||
if lb_id, ok := d.GetOk("lb_id"); ok {
|
||||
req.LBID = uint64(lb_id.(int))
|
||||
}
|
||||
|
||||
if bservice_id, ok := d.GetOk("bservice_id"); ok {
|
||||
req.BasicServiceID = uint64(bservice_id.(int))
|
||||
}
|
||||
|
||||
if status, ok := d.GetOk("status"); ok {
|
||||
req.Status = status.(string)
|
||||
}
|
||||
|
||||
if tech_status, ok := d.GetOk("tech_status"); ok {
|
||||
req.TechStatus = tech_status.(string)
|
||||
}
|
||||
|
||||
k8sList, err := c.CloudAPI().K8S().List(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -237,10 +269,42 @@ func utilityK8sListCheckPresence(ctx context.Context, d *schema.ResourceData, m
|
||||
return k8sList, nil
|
||||
}
|
||||
|
||||
func utilityK8sListDeletedCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (k8s.ListK8SClusters, error) {
|
||||
func utilityK8sListDeletedCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*k8s.ListK8SClusters, error) {
|
||||
c := m.(*controller.ControllerCfg)
|
||||
req := k8s.ListDeletedRequest{}
|
||||
|
||||
if by_id, ok := d.GetOk("by_id"); ok {
|
||||
req.ByID = uint64(by_id.(int))
|
||||
}
|
||||
|
||||
if name, ok := d.GetOk("name"); ok {
|
||||
req.Name = name.(string)
|
||||
}
|
||||
|
||||
if ip_address, ok := d.GetOk("ip_address"); ok {
|
||||
req.IPAddress = ip_address.(string)
|
||||
}
|
||||
|
||||
if rg_id, ok := d.GetOk("rg_id"); ok {
|
||||
req.RGID = uint64(rg_id.(int))
|
||||
}
|
||||
|
||||
if lb_id, ok := d.GetOk("lb_id"); ok {
|
||||
req.LBID = uint64(lb_id.(int))
|
||||
}
|
||||
|
||||
if bservice_id, ok := d.GetOk("bservice_id"); ok {
|
||||
req.BasicServiceID = uint64(bservice_id.(int))
|
||||
}
|
||||
|
||||
if status, ok := d.GetOk("status"); ok {
|
||||
req.Status = status.(string)
|
||||
}
|
||||
|
||||
if tech_status, ok := d.GetOk("tech_status"); ok {
|
||||
req.TechStatus = tech_status.(string)
|
||||
}
|
||||
|
||||
k8sList, err := c.CloudAPI().K8S().ListDeleted(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user