From 851763949d765fecd17d990efeeb78a8cd869235 Mon Sep 17 00:00:00 2001 From: luoping-12345 Date: Tue, 30 Apr 2024 16:50:39 +0800 Subject: [PATCH] feat(css): add data source CSS clusters (#4724) --- docs/data-sources/css_clusters.md | 194 ++++++++ huaweicloud/provider.go | 1 + ...ta_source_huaweicloud_css_clusters_test.go | 133 +++++ .../data_source_huaweicloud_css_clusters.go | 461 ++++++++++++++++++ 4 files changed, 789 insertions(+) create mode 100644 docs/data-sources/css_clusters.md create mode 100644 huaweicloud/services/acceptance/css/data_source_huaweicloud_css_clusters_test.go create mode 100644 huaweicloud/services/css/data_source_huaweicloud_css_clusters.go diff --git a/docs/data-sources/css_clusters.md b/docs/data-sources/css_clusters.md new file mode 100644 index 0000000000..a03e2823a2 --- /dev/null +++ b/docs/data-sources/css_clusters.md @@ -0,0 +1,194 @@ +--- +subcategory: "Cloud Search Service (CSS)" +layout: "huaweicloud" +page_title: "HuaweiCloud: huaweicloud_css_clusters" +description: |- + Use this data source to get the list of CSS clusters. +--- + +# huaweicloud_css_clusters + +Use this data source to get the list of CSS clusters. + +## Example Usage + +```hcl +variable "cluster_id" {} + +data "huaweicloud_css_clusters" "test" { + cluster_id = var.cluster_id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `region` - (Optional, String) Specifies the region in which to query the resource. + If omitted, the provider-level region will be used. + +* `cluster_id` - (Optional, String) Specifies the cluster ID. + +* `name` - (Optional, String) Specifies the cluster name. + +* `engine_type` - (Optional, String) Specifies the engine type. The values can be **elasticsearch** and **logstash**. + +* `engine_version` - (Optional, String) Specifies the engine version. + [For details](https://support.huaweicloud.com/intl/en-us/bulletin-css/css_05_0001.html) + +## Attribute Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The data source ID. + +* `clusters` - The list of cluster objects. + + The [clusters](#clusters_struct) structure is documented below. + + +The `clusters` block supports: + +* `id` - The cluster ID. + +* `name` - The cluster name. + +* `security_group_id` - The security group ID. + +* `bandwidth_size` - The public network bandwidth. The unit is Mbit/s. + +* `actions` - The current behavior of a cluster. + + **REBOOTING** indicates that the cluster is being restarted. + + **GROWING** indicates that the cluster is being scaled. + + **RESTORING** indicates that the cluster is being restored. + + **SNAPSHOTTING** indicates that a snapshot is being created. + +* `period` - Whether a cluster is billed on the yearly/monthly mode. + + **true**: The cluster is billed on the yearly/monthly mode. + + **false**: The cluster is billed on the pay-per-use mode. + +* `instances` - The list of node objects. + + The [instances](#clusters_instances_struct) structure is documented below. + +* `public_ip` - The public IP address information. + +* `status` - The cluster status. + + **100**: Creating. + + **200**: Available. + + **303**: Unavailable, for example, due to a creation failure. + +* `subnet_id` - The subnet ID. + +* `backup_available` - Whether the snapshot function is enabled. + + **true**: The snapshot function is enabled. + + **false**: The snapshot function is disabled. + +* `enterprise_project_id` - The ID of the enterprise project that a cluster belongs to. + If the user of the cluster does not enable the enterprise project, + the setting of this parameter is not returned. + +* `public_kibana_resp` - The kibana public network access information. + + The [public_kibana_resp](#clusters_public_kibana_resp_struct) structure is documented below. + +* `vpc_id` - The ID of a VPC. + +* `datastore` - The cluster data store. + + The [datastore](#clusters_datastore_struct) structure is documented below. + +* `endpoint` - The IP address and port number of the user used to access the VPC. + +* `https_enable` - The communication encryption status. + + **false**: Communication encryption is not enabled. + + **true**: Communication encryption is enabled. + +* `authority_enable` - Whether to enable authentication. + + **true**: Authentication is enabled for the cluster. + + **false**: Authentication is not enabled for the cluster. + +* `disk_encrypted` - Whether disks are encrypted. + + **true**: Disks are encrypted. + + **false**: Disks are not encrypted. + +* `elb_white_list` - The EIP whitelist. + + The [elb_white_list](#clusters_elb_white_list_struct) structure is documented below. + +* `updated_at` - The last modification time of a cluster. + +* `created_at` - The cluster creation time. + The returned cluster list is sorted by creation time in descending order. + The latest cluster is displayed at the top. + +* `bandwidth_resource_id` - The resource id for ES public network access. + + +The `instances` block supports: + +* `spec_code` - The node specifications. + +* `az_code` - The AZ of a node. + +* `ip` - The instance IP address. + +* `volume` - The instance volume. + + The [volume](#instances_volume_struct) structure is documented below. + +* `status` - The node status. + + **100**: Creating. + + **200**: Available. + + **303**: Unavailable, for example, due to a creation failure. + +* `type` - The type of the current node. + +* `id` - The cluster instance ID. + +* `name` - The cluster instance name. + + +The `volume` block supports: + +* `type` - The instance volume type. + +* `size` - The instance volume size. + + +The `public_kibana_resp` block supports: + +* `eip_size` - The bandwidth range. The unit is Mbit/s. + +* `elb_white_list_resp` - The elb white list of the cluster public kibana. + + The [elb_white_list_resp](#public_kibana_resp_elb_white_list_resp_struct) structure is documented below. + +* `public_kibana_ip` - The IP address for accessing kibana. + +* `bandwidth_resource_id` - The resource id for ES public network access. + + +The `elb_white_list_resp` block supports: + +* `enable_white_list` - Whether the kibana access control is enabled. + + **true**: Access control is enabled. + + **false**: Access control is disabled. + +* `white_list` - Whitelist of public network for accessing kibana. + + +The `datastore` block supports: + +* `type` - The engine type. + +* `version` - The version of the CSS cluster engine. + + +The `elb_white_list` block supports: + +* `enable_white_list` - Whether the public network access control is enabled. + + **true**: Public network access control is enabled. + + **false**: Public network access control is disabled. + +* `white_list` - Whitelist for public network access. diff --git a/huaweicloud/provider.go b/huaweicloud/provider.go index 76ca308aa7..b7839e6484 100644 --- a/huaweicloud/provider.go +++ b/huaweicloud/provider.go @@ -490,6 +490,7 @@ func Provider() *schema.Provider { "huaweicloud_csms_secret_version": dew.DataSourceDewCsmsSecret(), "huaweicloud_csms_events": dew.DataSourceDewCsmsEvents(), "huaweicloud_css_flavors": css.DataSourceCssFlavors(), + "huaweicloud_css_clusters": css.DataSourceCssClusters(), "huaweicloud_dataarts_architecture_ds_template_optionals": dataarts.DataSourceTemplateOptionalFields(), "huaweicloud_dataarts_studio_data_connections": dataarts.DataSourceDataConnections(), diff --git a/huaweicloud/services/acceptance/css/data_source_huaweicloud_css_clusters_test.go b/huaweicloud/services/acceptance/css/data_source_huaweicloud_css_clusters_test.go new file mode 100644 index 0000000000..c841f7a100 --- /dev/null +++ b/huaweicloud/services/acceptance/css/data_source_huaweicloud_css_clusters_test.go @@ -0,0 +1,133 @@ +package css + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + "github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance" +) + +func TestAccDataSourceCssClusters_basic(t *testing.T) { + dataSource := "data.huaweicloud_css_clusters.test" + rName := acceptance.RandomAccResourceName() + dc := acceptance.InitDataSourceCheck(dataSource) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acceptance.TestAccPreCheck(t) + }, + ProviderFactories: acceptance.TestAccProviderFactories, + Steps: []resource.TestStep{ + { + Config: testDataSourceDataSourceCssClusters_basic(rName), + Check: resource.ComposeTestCheckFunc( + dc.CheckResourceExists(), + resource.TestCheckResourceAttrSet(dataSource, "clusters.0.id"), + resource.TestCheckResourceAttrSet(dataSource, "clusters.0.name"), + resource.TestCheckResourceAttrSet(dataSource, "clusters.0.datastore.0.type"), + resource.TestCheckResourceAttrSet(dataSource, "clusters.0.datastore.0.version"), + + resource.TestCheckOutput("id_filter_is_useful", "true"), + resource.TestCheckOutput("name_filter_is_useful", "true"), + resource.TestCheckOutput("engine_type_filter_is_useful", "true"), + resource.TestCheckOutput("engine_version_filter_is_useful", "true"), + ), + }, + }, + }) +} + +func testDataSourceDataSourceCssClusters_basic(name string) string { + return fmt.Sprintf(` +%s + +data "huaweicloud_css_clusters" "test" { + depends_on = [ + huaweicloud_css_cluster.test, + huaweicloud_css_logstash_cluster.test, + ] +} + +locals { + cluster_id = data.huaweicloud_css_clusters.test.clusters[0].id + name = data.huaweicloud_css_clusters.test.clusters[0].name + engine_type = data.huaweicloud_css_clusters.test.clusters[0].datastore[0].type + engine_version = data.huaweicloud_css_clusters.test.clusters[0].datastore[0].version +} + +data "huaweicloud_css_clusters" "filter_by_id" { + cluster_id = local.cluster_id +} + +data "huaweicloud_css_clusters" "filter_by_name" { + name = local.name +} + +data "huaweicloud_css_clusters" "filter_by_engine_type" { + engine_type = local.engine_type +} + +data "huaweicloud_css_clusters" "filter_by_engine_version" { + engine_version = local.engine_version +} + +locals { + list_by_id = data.huaweicloud_css_clusters.filter_by_id.clusters + list_by_name = data.huaweicloud_css_clusters.filter_by_name.clusters + list_by_engine_type = data.huaweicloud_css_clusters.filter_by_engine_type.clusters + list_by_engine_version = data.huaweicloud_css_clusters.filter_by_engine_version.clusters +} + +output "id_filter_is_useful" { + value = length(local.list_by_id) > 0 && alltrue( + [for v in local.list_by_id[*].id : v == local.cluster_id] + ) +} + +output "name_filter_is_useful" { + value = length(local.list_by_name) > 0 && alltrue( + [for v in local.list_by_name[*].name : v == local.name] + ) +} + +output "engine_type_filter_is_useful" { + value = length(local.list_by_engine_type) > 0 && alltrue( + [for v in local.list_by_engine_type[*].datastore[0].type : v == local.engine_type] + ) +} + +output "engine_version_filter_is_useful" { + value = length(local.list_by_engine_version) > 0 && alltrue( + [for v in local.list_by_engine_version[*].datastore[0].version : v == local.engine_version] + ) +} +`, testDataSourceCssClusters_data_basic(name)) +} + +func testDataSourceCssClusters_data_basic(name string) string { + clusterString := testAccCssCluster_basic(name, "Test@passw0rd", 7, "bar") + return fmt.Sprintf(` +%[1]s + +resource "huaweicloud_css_logstash_cluster" "test" { + name = "%[2]s_1" + engine_version = "7.10.0" + + node_config { + flavor = "ess.spec-4u8g" + instance_number = 1 + volume { + volume_type = "HIGH" + size = 40 + } + } + + availability_zone = data.huaweicloud_availability_zones.test.names[0] + security_group_id = huaweicloud_networking_secgroup.test.id + subnet_id = huaweicloud_vpc_subnet.test.id + vpc_id = huaweicloud_vpc.test.id +} +`, clusterString, name) +} diff --git a/huaweicloud/services/css/data_source_huaweicloud_css_clusters.go b/huaweicloud/services/css/data_source_huaweicloud_css_clusters.go new file mode 100644 index 0000000000..0115fb4ddd --- /dev/null +++ b/huaweicloud/services/css/data_source_huaweicloud_css_clusters.go @@ -0,0 +1,461 @@ +// Generated by PMS #131 +package css + +import ( + "context" + + "github.com/hashicorp/go-multierror" + "github.com/hashicorp/go-uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/tidwall/gjson" + + "github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/config" + "github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/helper/filters" + "github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/helper/httphelper" + "github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/helper/schemas" +) + +func DataSourceCssClusters() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceCssClustersRead, + + Schema: map[string]*schema.Schema{ + "region": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: `Specifies the region in which to query the resource. If omitted, the provider-level region will be used.`, + }, + "cluster_id": { + Type: schema.TypeString, + Optional: true, + Description: `Specifies the cluster ID.`, + }, + "name": { + Type: schema.TypeString, + Optional: true, + Description: `Specifies the cluster name.`, + }, + "engine_type": { + Type: schema.TypeString, + Optional: true, + Description: `Specifies the engine type. The values can be **elasticsearch** and **logstash**.`, + }, + "engine_version": { + Type: schema.TypeString, + Optional: true, + Description: `Specifies the engine version.`, + }, + "clusters": { + Type: schema.TypeList, + Computed: true, + Description: `The list of cluster objects.`, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Computed: true, + Description: `The cluster ID.`, + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: `The cluster name.`, + }, + "security_group_id": { + Type: schema.TypeString, + Computed: true, + Description: `The security group ID.`, + }, + "bandwidth_size": { + Type: schema.TypeInt, + Computed: true, + Description: `The public network bandwidth. The unit is Mbit/s.`, + }, + "actions": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: `The current behavior of a cluster.`, + }, + "period": { + Type: schema.TypeBool, + Computed: true, + Description: `Whether a cluster is billed on the yearly/monthly mode.`, + }, + "instances": { + Type: schema.TypeList, + Computed: true, + Description: `The list of node objects.`, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "spec_code": { + Type: schema.TypeString, + Computed: true, + Description: `The node specifications.`, + }, + "az_code": { + Type: schema.TypeString, + Computed: true, + Description: `The AZ of a node.`, + }, + "ip": { + Type: schema.TypeString, + Computed: true, + Description: `The instance IP address.`, + }, + "volume": { + Type: schema.TypeList, + Computed: true, + Description: `The instance volume.`, + Elem: cluInsVolElem(), + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: `The node status.`, + }, + "type": { + Type: schema.TypeString, + Computed: true, + Description: `The type of the current node.`, + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: `The cluster instance ID.`, + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: `The cluster instance name.`, + }, + }, + }, + }, + "public_ip": { + Type: schema.TypeString, + Computed: true, + Description: `The public IP address information.`, + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: `The cluster status.`, + }, + "subnet_id": { + Type: schema.TypeString, + Computed: true, + Description: `The subnet ID.`, + }, + "backup_available": { + Type: schema.TypeBool, + Computed: true, + Description: `Whether the snapshot function is enabled.`, + }, + "enterprise_project_id": { + Type: schema.TypeString, + Computed: true, + Description: `The ID of the enterprise project that a cluster belongs to.`, + }, + "public_kibana_resp": { + Type: schema.TypeList, + Computed: true, + Description: `The kibana public network access information.`, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "eip_size": { + Type: schema.TypeInt, + Computed: true, + Description: `The bandwidth range. The unit is Mbit/s.`, + }, + "elb_white_list_resp": { + Type: schema.TypeList, + Computed: true, + Description: `The elb white list of the cluster public kibana.`, + Elem: cpkrewlrElem(), + }, + "public_kibana_ip": { + Type: schema.TypeString, + Computed: true, + Description: `The IP address for accessing kibana.`, + }, + "bandwidth_resource_id": { + Type: schema.TypeString, + Computed: true, + Description: `The resource id for ES public network access.`, + }, + }, + }, + }, + "vpc_id": { + Type: schema.TypeString, + Computed: true, + Description: `The ID of a VPC.`, + }, + "datastore": { + Type: schema.TypeList, + Computed: true, + Description: `The cluster data store.`, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Computed: true, + Description: `The engine type.`, + }, + "version": { + Type: schema.TypeString, + Computed: true, + Description: `The version of the CSS cluster engine.`, + }, + }, + }, + }, + "endpoint": { + Type: schema.TypeString, + Computed: true, + Description: `The IP address and port number of the user used to access the VPC.`, + }, + "https_enable": { + Type: schema.TypeBool, + Computed: true, + Description: `The communication encryption status.`, + }, + "authority_enable": { + Type: schema.TypeBool, + Computed: true, + Description: `Whether to enable authentication.`, + }, + "disk_encrypted": { + Type: schema.TypeBool, + Computed: true, + Description: `Whether disks are encrypted.`, + }, + "elb_white_list": { + Type: schema.TypeList, + Computed: true, + Description: `The EIP whitelist.`, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enable_white_list": { + Type: schema.TypeBool, + Computed: true, + Description: `Whether the public network access control is enabled.`, + }, + "white_list": { + Type: schema.TypeString, + Computed: true, + Description: `Whitelist for public network access.`, + }, + }, + }, + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: `The last modification time of a cluster.`, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: `The cluster creation time.`, + }, + "bandwidth_resource_id": { + Type: schema.TypeString, + Computed: true, + Description: `The resource id for ES public network access.`, + }, + }, + }, + }, + }, + } +} + +// cpkrewlrElem +// The Elem of "clusters.public_kibana_resp.elb_white_list_resp" +func cpkrewlrElem() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enable_white_list": { + Type: schema.TypeBool, + Computed: true, + Description: `Whether the kibana access control is enabled.`, + }, + "white_list": { + Type: schema.TypeString, + Computed: true, + Description: `Whitelist of public network for accessing kibana.`, + }, + }, + } +} + +// cluInsVolElem +// The Elem of "clusters.instances.volume" +func cluInsVolElem() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Computed: true, + Description: `The instance volume type.`, + }, + "size": { + Type: schema.TypeInt, + Computed: true, + Description: `The instance volume size.`, + }, + }, + } +} + +type ClustersDSWrapper struct { + *schemas.ResourceDataWrapper + Config *config.Config +} + +func newClustersDSWrapper(d *schema.ResourceData, meta interface{}) *ClustersDSWrapper { + return &ClustersDSWrapper{ + ResourceDataWrapper: schemas.NewSchemaWrapper(d), + Config: meta.(*config.Config), + } +} + +func dataSourceCssClustersRead(_ context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + wrapper := newClustersDSWrapper(d, meta) + lisCluDetRst, err := wrapper.ListClustersDetails() + if err != nil { + return diag.FromErr(err) + } + + id, err := uuid.GenerateUUID() + if err != nil { + return diag.FromErr(err) + } + d.SetId(id) + + err = wrapper.listClustersDetailsToSchema(lisCluDetRst) + if err != nil { + return diag.FromErr(err) + } + + return nil +} + +// @API CSS GET /v1.0/{project_id}/clusters +func (w *ClustersDSWrapper) ListClustersDetails() (*gjson.Result, error) { + client, err := w.NewClient(w.Config, "css") + if err != nil { + return nil, err + } + + uri := "/v1.0/{project_id}/clusters" + return httphelper.New(client). + Method("GET"). + URI(uri). + OffsetStart(1). + OffsetPager("clusters", "start", "limit", 10). + Filter( + filters.New().From("clusters"). + Where("name", "=", w.Get("name")). + Where("id", "=", w.Get("cluster_id")). + Where("datastore.type", "=", w.Get("engine_type")). + Where("datastore.version", "=", w.Get("engine_version")), + ). + Request(). + Result() +} + +func (w *ClustersDSWrapper) listClustersDetailsToSchema(body *gjson.Result) error { + d := w.ResourceData + mErr := multierror.Append(nil, + d.Set("region", w.Config.GetRegion(w.ResourceData)), + d.Set("clusters", schemas.SliceToList(body.Get("clusters"), + func(cluster gjson.Result) any { + return map[string]any{ + "id": cluster.Get("id").Value(), + "name": cluster.Get("name").Value(), + "security_group_id": cluster.Get("securityGroupId").Value(), + "bandwidth_size": cluster.Get("bandwidthSize").Value(), + "actions": schemas.SliceToStrList(cluster.Get("actions")), + "period": cluster.Get("period").Value(), + "instances": schemas.SliceToList(cluster.Get("instances"), + func(instance gjson.Result) any { + return map[string]any{ + "spec_code": instance.Get("specCode").Value(), + "az_code": instance.Get("azCode").Value(), + "ip": instance.Get("ip").Value(), + "volume": w.setCluInsVol(instance), + "status": instance.Get("status").Value(), + "type": instance.Get("type").Value(), + "id": instance.Get("id").Value(), + "name": instance.Get("name").Value(), + } + }, + ), + "public_ip": cluster.Get("publicIp").Value(), + "status": cluster.Get("status").Value(), + "subnet_id": cluster.Get("subnetId").Value(), + "backup_available": cluster.Get("backupAvailable").Value(), + "enterprise_project_id": cluster.Get("enterpriseProjectId").Value(), + "public_kibana_resp": schemas.SliceToList(cluster.Get("publicKibanaResp"), + func(pubKibRes gjson.Result) any { + return map[string]any{ + "eip_size": pubKibRes.Get("eipSize").Value(), + "elb_white_list_resp": w.setCpkrewlr(pubKibRes), + "public_kibana_ip": pubKibRes.Get("publicKibanaIp").Value(), + "bandwidth_resource_id": pubKibRes.Get("bandwidthResourceId").Value(), + } + }, + ), + "vpc_id": cluster.Get("vpcId").Value(), + "datastore": schemas.SliceToList(cluster.Get("datastore"), + func(datastore gjson.Result) any { + return map[string]any{ + "type": datastore.Get("type").Value(), + "version": datastore.Get("version").Value(), + } + }, + ), + "endpoint": cluster.Get("endpoint").Value(), + "https_enable": cluster.Get("httpsEnable").Value(), + "authority_enable": cluster.Get("authorityEnable").Value(), + "disk_encrypted": cluster.Get("diskEncrypted").Value(), + "elb_white_list": schemas.SliceToList(cluster.Get("elbWhiteList"), + func(elbWhiteList gjson.Result) any { + return map[string]any{ + "enable_white_list": elbWhiteList.Get("enableWhiteList").Value(), + "white_list": elbWhiteList.Get("whiteList").Value(), + } + }, + ), + "updated_at": cluster.Get("updated").Value(), + "created_at": cluster.Get("created").Value(), + "bandwidth_resource_id": cluster.Get("bandwidthResourceId").Value(), + } + }, + )), + ) + return mErr.ErrorOrNil() +} + +func (*ClustersDSWrapper) setCluInsVol(instance gjson.Result) any { + return schemas.SliceToList(instance.Get("volume"), func(volume gjson.Result) any { + return map[string]any{ + "type": volume.Get("type").Value(), + "size": volume.Get("size").Value(), + } + }) +} + +func (*ClustersDSWrapper) setCpkrewlr(pubKibRes gjson.Result) any { + return schemas.SliceToList(pubKibRes.Get("elbWhiteListResp"), func(elbWhiLisRes gjson.Result) any { + return map[string]any{ + "enable_white_list": elbWhiLisRes.Get("enableWhiteList").Value(), + "white_list": elbWhiLisRes.Get("whiteList").Value(), + } + }) +}