From dd45d2a8026f4db2c145790fe5ac632201b1d7a8 Mon Sep 17 00:00:00 2001 From: Pushpalatha555 Date: Thu, 4 Aug 2022 17:41:42 +0530 Subject: [PATCH 1/2] API for LBPOOL Member group --- pkg/client/load_balancer.go | 19 +++++++++++++++++++ pkg/models/load_balancer.go | 12 ++++++++++++ 2 files changed, 31 insertions(+) diff --git a/pkg/client/load_balancer.go b/pkg/client/load_balancer.go index 3e2aaca..2bf0bc4 100644 --- a/pkg/client/load_balancer.go +++ b/pkg/client/load_balancer.go @@ -526,3 +526,22 @@ func (lb *LoadBalancerAPIService) GetSpecificLBVirtualServer( return LBVSResp, err } + +func (lb *LoadBalancerAPIService) GetLBPoolMemberGroup( + ctx context.Context, + serviceID int, +) (models.GetMemeberGroupForPool, error) { + LBMemberGroupResp := models.GetMemeberGroupForPool{} + LBMemberGroupInput := &api{ + method: "GET", + path: fmt.Sprintf("%s/%s/%d/%s", + consts.NetworksPath, consts.ServerPath, serviceID, consts.GroupsPath), + client: lb.Client, + jsonParser: func(body []byte) error { + return json.Unmarshal(body, &LBMemberGroupResp) + }, + } + err := LBMemberGroupInput.do(ctx, nil, nil) + + return LBMemberGroupResp, err +} diff --git a/pkg/models/load_balancer.go b/pkg/models/load_balancer.go index 0c65041..e590865 100644 --- a/pkg/models/load_balancer.go +++ b/pkg/models/load_balancer.go @@ -861,3 +861,15 @@ type GetSpecificLBVirtualServersResp struct { SSLCert SSLCert `json:"sslCert"` SSLServerCert SSLServerCert `json:"sslServerCert"` } + +type GetMemeberGroupForPool struct { + MemeberGroup []MemeberGroups `json:"groups"` +} + +type MemeberGroups struct { + ID int `json:"id" tf:"id,computed"` + Name string `json:"name"` + Description interface{} `json:"description"` + InternalID string `json:"internalId"` + ExternalID string `json:"externalId" tf:"external_id,computed"` +} From 58360e55d329631df5507ea699e4dd0a8bda263b Mon Sep 17 00:00:00 2001 From: Pushpalatha555 Date: Fri, 5 Aug 2022 10:19:33 +0530 Subject: [PATCH 2/2] fixing the lint errors --- pkg/client/load_balancer.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/client/load_balancer.go b/pkg/client/load_balancer.go index ba52f7c..290e4ad 100644 --- a/pkg/client/load_balancer.go +++ b/pkg/client/load_balancer.go @@ -544,7 +544,6 @@ func (lb *LoadBalancerAPIService) GetLBPoolMemberGroup( err := LBMemberGroupInput.do(ctx, nil, nil) return LBMemberGroupResp, err - } func (lb *LoadBalancerAPIService) GetLBVirtualServerSSLCerts(