From 1ed109b3154357b66274833fa4f593e31dd51923 Mon Sep 17 00:00:00 2001 From: Pushpalatha555 Date: Fri, 22 Jul 2022 12:00:00 +0530 Subject: [PATCH 1/4] GO SDK update and models added for load balancer and its configurations --- pkg/client/load_balancer.go | 104 +++++ pkg/client/load_balancer_test.go | 379 +++++++++++++++++- pkg/models/load_balancer.go | 636 ++++++++++++++++++++----------- 3 files changed, 885 insertions(+), 234 deletions(-) diff --git a/pkg/client/load_balancer.go b/pkg/client/load_balancer.go index b604971..3e2aaca 100644 --- a/pkg/client/load_balancer.go +++ b/pkg/client/load_balancer.go @@ -34,6 +34,26 @@ func (lb *LoadBalancerAPIService) CreateLoadBalancer( return loadBalancerResp, err } +func (lb *LoadBalancerAPIService) UpdateLoadBalancer( + ctx context.Context, + lbID int, + request models.CreateLoadBalancerRequest, +) (models.CreateNetworkLoadBalancerResp, error) { + loadBalancerResp := models.CreateNetworkLoadBalancerResp{} + loadBalancerAPI := &api{ + method: "PUT", + path: fmt.Sprintf("%s/%d", + consts.LoadBalancerPath, lbID), + client: lb.Client, + jsonParser: func(body []byte) error { + return json.Unmarshal(body, &loadBalancerResp) + }, + } + err := loadBalancerAPI.do(ctx, request, nil) + + return loadBalancerResp, err +} + func (lb *LoadBalancerAPIService) DeleteLoadBalancer( ctx context.Context, lbID int, @@ -126,6 +146,27 @@ func (lb *LoadBalancerAPIService) CreateLBMonitor( return LBMonitorResp, err } +func (lb *LoadBalancerAPIService) UpdateLBMonitor( + ctx context.Context, + request models.CreateLBMonitor, + lbID int, + lbmonitorID int, +) (models.CreateLBMonitorResp, error) { + LBMonitorResp := models.CreateLBMonitorResp{} + LBMonitorAPI := &api{ + method: "PUT", + path: fmt.Sprintf("%s/%d/%s/%d", + consts.LoadBalancerPath, lbID, consts.LoadBalancerMonitorPath, lbmonitorID), + client: lb.Client, + jsonParser: func(body []byte) error { + return json.Unmarshal(body, &LBMonitorResp) + }, + } + err := LBMonitorAPI.do(ctx, request, nil) + + return LBMonitorResp, err +} + func (lb *LoadBalancerAPIService) DeleteLBMonitor( ctx context.Context, lbID int, @@ -205,6 +246,27 @@ func (lb *LoadBalancerAPIService) CreateLBProfile( return LBProfileResp, err } +func (lb *LoadBalancerAPIService) UpdateLBProfile( + ctx context.Context, + request models.CreateLBProfile, + lbID int, + lbProfileID int, +) (models.CreateLBProfileResp, error) { + LBProfileResp := models.CreateLBProfileResp{} + LBProfileAPI := &api{ + method: "PUT", + path: fmt.Sprintf("%s/%d/%s/%d", + consts.LoadBalancerPath, lbID, consts.LoadBalancerProfilePath, lbProfileID), + client: lb.Client, + jsonParser: func(body []byte) error { + return json.Unmarshal(body, &LBProfileResp) + }, + } + err := LBProfileAPI.do(ctx, request, nil) + + return LBProfileResp, err +} + func (lb *LoadBalancerAPIService) DeleteLBProfile( ctx context.Context, lbID int, @@ -285,6 +347,27 @@ func (lb *LoadBalancerAPIService) CreateLBPool( return LBPoolResp, err } +func (lb *LoadBalancerAPIService) UpdateLBPool( + ctx context.Context, + request models.CreateLBPool, + lbID int, + lbPoolID int, +) (models.CreateLBPoolResp, error) { + LBPoolResp := models.CreateLBPoolResp{} + LBPoolAPI := &api{ + method: "PUT", + path: fmt.Sprintf("%s/%d/%s/%d", + consts.LoadBalancerPath, lbID, consts.LoadBalancerPoolPath, lbPoolID), + client: lb.Client, + jsonParser: func(body []byte) error { + return json.Unmarshal(body, &LBPoolResp) + }, + } + err := LBPoolAPI.do(ctx, request, nil) + + return LBPoolResp, err +} + func (lb *LoadBalancerAPIService) DeleteLBPool( ctx context.Context, lbID int, @@ -364,6 +447,27 @@ func (lb *LoadBalancerAPIService) CreateLBVirtualServers( return LBVSResp, err } +func (lb *LoadBalancerAPIService) UpdateLBVirtualServers( + ctx context.Context, + request models.CreateLBVirtualServers, + lbID int, + lbVirtualServerID int, +) (models.LBVirtualServersResp, error) { + LBVSResp := models.LBVirtualServersResp{} + LBVSAPI := &api{ + method: "PUT", + path: fmt.Sprintf("%s/%d/%s/%d", + consts.LoadBalancerPath, lbID, consts.LoadBalancerVirtualServersPath, lbVirtualServerID), + client: lb.Client, + jsonParser: func(body []byte) error { + return json.Unmarshal(body, &LBVSResp) + }, + } + err := LBVSAPI.do(ctx, request, nil) + + return LBVSResp, err +} + func (lb *LoadBalancerAPIService) DeleteLBVirtualServers( ctx context.Context, lbID int, diff --git a/pkg/client/load_balancer_test.go b/pkg/client/load_balancer_test.go index 6cc236a..69ade53 100644 --- a/pkg/client/load_balancer_test.go +++ b/pkg/client/load_balancer_test.go @@ -88,6 +88,80 @@ func Test_loadBalancerAPIService_CreateLoadBalancer(t *testing.T) { } } +func Test_loadBalancerAPIService_UpdateLoadBalancer(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + tests := []struct { + name string + args models.CreateLoadBalancerRequest + given func(m *MockAPIClientHandler) + want models.CreateNetworkLoadBalancerResp + wantErr bool + }{ + { + name: "Normal test case 1: Create LB", + args: models.CreateLoadBalancerRequest{ + NetworkLoadBalancer: models.CreateNetworkLoadBalancerRequest{ + Name: "tf_LB", + }, + }, + + given: func(m *MockAPIClientHandler) { + m.EXPECT().getHost().Return(mockHost) + path := mockHost + "/" + consts.VmaasCmpAPIBasePath + "/load-balancers/1" + method := "PUT" + headers := getDefaultHeaders() + req, _ := http.NewRequest(method, path, nil) + + m.EXPECT().getVersion().Return(999999) + m.EXPECT().prepareRequest(gomock.Any(), path, method, + models.CreateLoadBalancerRequest{ + NetworkLoadBalancer: models.CreateNetworkLoadBalancerRequest{ + Name: "tf_LB", + }, + }, + headers, url.Values{}, url.Values{}, "", nil).Return(req, nil) + + m.EXPECT().callAPI(req).Return(&http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewReader([]byte(` + { + "success": true + } + `))), + }, nil) + }, + want: models.CreateNetworkLoadBalancerResp{ + Success: true, + NetworkLoadBalancerResp: models.NetworkLoadBalancerResp{}, + }, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mockAPIClient := NewMockAPIClientHandler(ctrl) + tt.given(mockAPIClient) + lb := LoadBalancerAPIService{ + Client: mockAPIClient, + Cfg: Configuration{ + Host: mockHost, + }, + } + got, err := lb.UpdateLoadBalancer(context.Background(), 1, tt.args) + if (err != nil) != tt.wantErr { + t.Errorf("LoadBalancerAPIService.UpdateLoadBalancer() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("LoadBalancerAPIService.UpdateLoadBalancer() = %v, want %v", got, tt.want) + } + }) + } +} + func Test_loadBalancerAPIService_DeleteLoadBalancer(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -179,7 +253,6 @@ func Test_loadBalancerAPIService_GetSpecificLoadBalancers(t *testing.T) { "loadBalancer":{ "id": 1, "name":"test_template_get_a_specific_LB" - } } `))) @@ -297,6 +370,80 @@ func Test_loadBalancerAPIService_CreateLBMonitor(t *testing.T) { } } +func Test_loadBalancerAPIService_UpdateLBMonitor(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + tests := []struct { + name string + args models.CreateLBMonitor + given func(m *MockAPIClientHandler) + want models.CreateLBMonitorResp + wantErr bool + }{ + { + name: "Normal test case 1: Create LB-Monitor", + args: models.CreateLBMonitor{ + CreateLBMonitorReq: models.CreateLBMonitorReq{ + Name: "tf_LBMonitor", + }, + }, + + given: func(m *MockAPIClientHandler) { + m.EXPECT().getHost().Return(mockHost) + path := mockHost + "/" + consts.VmaasCmpAPIBasePath + "/load-balancers/1/monitors/1" + method := "PUT" + headers := getDefaultHeaders() + req, _ := http.NewRequest(method, path, nil) + + m.EXPECT().getVersion().Return(999999) + m.EXPECT().prepareRequest(gomock.Any(), path, method, + models.CreateLBMonitor{ + CreateLBMonitorReq: models.CreateLBMonitorReq{ + Name: "tf_LBMonitor", + }, + }, + headers, url.Values{}, url.Values{}, "", nil).Return(req, nil) + + m.EXPECT().callAPI(req).Return(&http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewReader([]byte(` + { + "success": true + } + `))), + }, nil) + }, + want: models.CreateLBMonitorResp{ + Success: true, + LBMonitorResp: models.LBMonitorResp{}, + }, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mockAPIClient := NewMockAPIClientHandler(ctrl) + tt.given(mockAPIClient) + lb := LoadBalancerAPIService{ + Client: mockAPIClient, + Cfg: Configuration{ + Host: mockHost, + }, + } + got, err := lb.UpdateLBMonitor(context.Background(), tt.args, 1, 1) + if (err != nil) != tt.wantErr { + t.Errorf("LoadBalancerAPIService.UpdateLBMonitor() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("LoadBalancerAPIService.UpdateLBMonitor() = %v, want %v", got, tt.want) + } + }) + } +} + func Test_loadBalancerAPIService_DeleteLBMonitor(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -386,7 +533,6 @@ func Test_loadBalancerAPIService_GetSpecificLBMonitor(t *testing.T) { { "loadBalancerMonitor":{ "name":"test_template_get_a_specific_LB" - } } `))) @@ -503,6 +649,80 @@ func Test_loadBalancerAPIService_CreateLBProfile(t *testing.T) { } } +func Test_loadBalancerAPIService_UpdateLBProfile(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + tests := []struct { + name string + args models.CreateLBProfile + given func(m *MockAPIClientHandler) + want models.CreateLBProfileResp + wantErr bool + }{ + { + name: "Normal test case 1: Create LB Profile", + args: models.CreateLBProfile{ + CreateLBProfileReq: models.CreateLBProfileReq{ + Name: "tf_LB-Profile", + }, + }, + + given: func(m *MockAPIClientHandler) { + m.EXPECT().getHost().Return(mockHost) + path := mockHost + "/" + consts.VmaasCmpAPIBasePath + "/load-balancers/1/profiles/1" + method := "PUT" + headers := getDefaultHeaders() + req, _ := http.NewRequest(method, path, nil) + + m.EXPECT().getVersion().Return(999999) + m.EXPECT().prepareRequest(gomock.Any(), path, method, + models.CreateLBProfile{ + CreateLBProfileReq: models.CreateLBProfileReq{ + Name: "tf_LB-Profile", + }, + }, + headers, url.Values{}, url.Values{}, "", nil).Return(req, nil) + + m.EXPECT().callAPI(req).Return(&http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewReader([]byte(` + { + "success": true + } + `))), + }, nil) + }, + want: models.CreateLBProfileResp{ + Success: true, + LBProfileResp: models.LBProfileResp{}, + }, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mockAPIClient := NewMockAPIClientHandler(ctrl) + tt.given(mockAPIClient) + lb := LoadBalancerAPIService{ + Client: mockAPIClient, + Cfg: Configuration{ + Host: mockHost, + }, + } + got, err := lb.UpdateLBProfile(context.Background(), tt.args, 1, 1) + if (err != nil) != tt.wantErr { + t.Errorf("LoadBalancerAPIService.UpdateLBProfile() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("LoadBalancerAPIService.UpdateLBProfile() = %v, want %v", got, tt.want) + } + }) + } +} + func Test_loadBalancerAPIService_DeleteLBProfile(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -594,7 +814,6 @@ func Test_loadBalancerAPIService_GetSpecificLBProfile(t *testing.T) { "loadBalancerProfile":{ "id": 1, "name":"test_template_get_a_specific_LB-P" - } } `))) @@ -609,7 +828,7 @@ func Test_loadBalancerAPIService_GetSpecificLBProfile(t *testing.T) { }, want: models.GetLBSpecificProfile{ GetLBSpecificProfilesResp: models.GetLBSpecificProfilesResp{ - ID: 1, + ID: 0, Name: templateName, }, }, @@ -712,6 +931,80 @@ func Test_loadBalancerAPIService_CreateLBPool(t *testing.T) { } } +func Test_loadBalancerAPIService_UpdateLBPool(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + tests := []struct { + name string + args models.CreateLBPool + given func(m *MockAPIClientHandler) + want models.CreateLBPoolResp + wantErr bool + }{ + { + name: "Normal test case 1: Create LB-Pool", + args: models.CreateLBPool{ + CreateLBPoolReq: models.CreateLBPoolReq{ + Name: "tf_LB-Pool", + }, + }, + + given: func(m *MockAPIClientHandler) { + m.EXPECT().getHost().Return(mockHost) + path := mockHost + "/" + consts.VmaasCmpAPIBasePath + "/load-balancers/1/pools/1" + method := "PUT" + headers := getDefaultHeaders() + req, _ := http.NewRequest(method, path, nil) + + m.EXPECT().getVersion().Return(999999) + m.EXPECT().prepareRequest(gomock.Any(), path, method, + models.CreateLBPool{ + CreateLBPoolReq: models.CreateLBPoolReq{ + Name: "tf_LB-Pool", + }, + }, + headers, url.Values{}, url.Values{}, "", nil).Return(req, nil) + + m.EXPECT().callAPI(req).Return(&http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewReader([]byte(` + { + "success": true + } + `))), + }, nil) + }, + want: models.CreateLBPoolResp{ + Success: true, + LBPoolResp: models.LBPoolResp{}, + }, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mockAPIClient := NewMockAPIClientHandler(ctrl) + tt.given(mockAPIClient) + lb := LoadBalancerAPIService{ + Client: mockAPIClient, + Cfg: Configuration{ + Host: mockHost, + }, + } + got, err := lb.UpdateLBPool(context.Background(), tt.args, 1, 1) + if (err != nil) != tt.wantErr { + t.Errorf("LoadBalancerAPIService.UpdateLBPool() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("LoadBalancerAPIService.UpdateLBPool() = %v, want %v", got, tt.want) + } + }) + } +} + func Test_loadBalancerAPIService_DeleteLBPool(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -803,7 +1096,6 @@ func Test_loadBalancerAPIService_GetSpecificLBPool(t *testing.T) { "loadBalancerPool":{ "id": 1, "name":"test_template_get_a_specific_LB-P" - } } `))) @@ -818,7 +1110,7 @@ func Test_loadBalancerAPIService_GetSpecificLBPool(t *testing.T) { }, want: models.GetSpecificLBPool{ GetSpecificLBPoolResp: models.GetSpecificLBPoolResp{ - ID: 1, + ID: 0, Name: templateName, }, }, @@ -920,6 +1212,80 @@ func Test_loadBalancerAPIService_CreateLBVirtualServers(t *testing.T) { }) } } + +func Test_loadBalancerAPIService_UpdateLBVirtualServers(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + tests := []struct { + name string + args models.CreateLBVirtualServers + given func(m *MockAPIClientHandler) + want models.LBVirtualServersResp + wantErr bool + }{ + { + name: "Normal test case 1: Create LB-VS", + args: models.CreateLBVirtualServers{ + CreateLBVirtualServersReq: models.CreateLBVirtualServersReq{ + VipName: "tf_LB", + }, + }, + + given: func(m *MockAPIClientHandler) { + m.EXPECT().getHost().Return(mockHost) + path := mockHost + "/" + consts.VmaasCmpAPIBasePath + "/load-balancers/1/virtual-servers/1" + method := "PUT" + headers := getDefaultHeaders() + req, _ := http.NewRequest(method, path, nil) + + m.EXPECT().getVersion().Return(999999) + m.EXPECT().prepareRequest(gomock.Any(), path, method, + models.CreateLBVirtualServers{ + CreateLBVirtualServersReq: models.CreateLBVirtualServersReq{ + VipName: "tf_LB", + }, + }, + headers, url.Values{}, url.Values{}, "", nil).Return(req, nil) + + m.EXPECT().callAPI(req).Return(&http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewReader([]byte(` + { + "success": true + } + `))), + }, nil) + }, + want: models.LBVirtualServersResp{ + Success: true, + CreateLBVirtualServersResp: models.CreateLBVirtualServersResp{}, + }, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mockAPIClient := NewMockAPIClientHandler(ctrl) + tt.given(mockAPIClient) + lb := LoadBalancerAPIService{ + Client: mockAPIClient, + Cfg: Configuration{ + Host: mockHost, + }, + } + got, err := lb.UpdateLBVirtualServers(context.Background(), tt.args, 1, 1) + if (err != nil) != tt.wantErr { + t.Errorf("LoadBalancerAPIService.UpdateLBVirtualServers() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("LoadBalancerAPIService.UpdateLBVirtualServers() = %v, want %v", got, tt.want) + } + }) + } +} func Test_loadBalancerAPIService_DeleteLBVirtualServers(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -1011,7 +1377,6 @@ func Test_loadBalancerAPIService_GetSpecificLBVirtualServers(t *testing.T) { "loadBalancerInstance":{ "id": 1, "name":"test_template_get_a_specific_LB-VS" - } } `))) diff --git a/pkg/models/load_balancer.go b/pkg/models/load_balancer.go index 3fc1cfc..f611bb5 100644 --- a/pkg/models/load_balancer.go +++ b/pkg/models/load_balancer.go @@ -11,25 +11,30 @@ type CreateLoadBalancerRequest struct { type CreateNetworkLoadBalancerRequest struct { ID int `json:"-" tf:"id,computed"` - Name string `json:"name"` - Type string `json:"type"` - Description string `json:"description"` - NetworkServerID int `json:"networkServerId" tf:"network_server_id"` - Enabled bool `json:"enabled"` - Visibility string `json:"visibility"` - Config CreateConfig `json:"config"` - ResourcePermissions EnableResourcePermissions `json:"resourcePermission" tf:"resource_permission"` + Name string `json:"name" tf:"name"` + Type string `json:"type" tf:"lb_type,computed"` + Description string `json:"description" tf:"description"` + NetworkServerID int `json:"networkServerId" tf:"network_server_id,computed"` + Enabled bool `json:"enabled" tf:"enabled"` + Config *CreateConfig `json:"config" tf:"config,sub"` + ResourcePermissions EnableResourcePermissions `json:"resourcePermissions" tf:"group_access"` } -type CreateConfig struct { - AdminState bool `json:"adminState" tf:"admin_state"` - Loglevel string `json:"loglevel"` - Size string `json:"size"` - Tier1 string `json:"tier1"` +type EnableResourcePermissions struct { + All bool `json:"all,omitempty" tf:"all"` + Sites []PermissionSites `json:"sites,omitempty" tf:"sites"` } -type EnableResourcePermissions struct { - All bool `json:"all"` +type PermissionSites struct { + ID int `json:"id,omitempty" tf:"id"` + Default bool `json:"default,omitempty" tf:"default"` +} + +type CreateConfig struct { + AdminState bool `json:"adminState" tf:"admin_state"` + Loglevel string `json:"loglevel" tf:"log_level"` + Size string `json:"size" tf:"size"` + Tier1 string `json:"tier1" tf:"tier1_gateways"` } type GetLoadBalancerTypes struct { @@ -52,6 +57,7 @@ type CreateNetworkLoadBalancerResp struct { type NetworkLoadBalancerResp struct { ID int `json:"id" tf:"id,computed"` + LbID int `json:"lb_id" tf:"lb_id,computed"` Name string `json:"name"` AccountID int `json:"accountId"` Cloud CloudInfo `json:"cloud"` @@ -83,7 +89,8 @@ type GetNetworkLoadBalancers struct { } type GetNetworkLoadBalancerResp struct { - ID int `json:"id"` + ID int `json:"id" tf:"id,computed"` + LbID int `json:"lb_id" tf:"lb_id,computed"` Name string `json:"name"` AccountID int `json:"accountId"` Cloud CloudInfo `json:"cloud"` @@ -138,22 +145,92 @@ type CreateLBMonitor struct { } type CreateLBMonitorReq struct { - ID int `json:"-" tf:"id,computed"` - Name string `json:"name"` - Description string `json:"description"` - MonitorType string `json:"monitorType" tf:"monitor_type"` - MonitorTimeout int `json:"monitorTimeout" tf:"monitor_timeout"` - MonitorInterval int `json:"monitorInterval" tf:"monitor_interval"` - SendVersion string `json:"sendVersion" tf:"send_version"` - SendType string `json:"sendType" tf:"send_type"` - ReceiveCode string `json:"receiveCode" tf:"receive_code"` - MonitorDestination string `json:"monitorDestination" tf:"monitor_destination"` - MonitorReverse bool `json:"monitorReverse" tf:"monitor_reverse"` - MonitorTransparent bool `json:"monitorTransparent" tf:"monitor_transparent"` - MonitorAdaptive bool `json:"monitorAdaptive" tf:"monitor_adaptive"` - FallCount int `json:"fallCount" tf:"fall_count"` - RiseCount int `json:"riseCount" tf:"rise_count"` - AliasPort int `json:"aliasPort" tf:"alias_port"` + ID int `json:"-" tf:"id,computed"` + LbID int `json:"-" tf:"lb_id"` + Name string `json:"name" tf:"name"` + Description string `json:"description" tf:"description"` + Type string `json:"monitorType" tf:"type"` + Timeout int `json:"monitorTimeout"` + Interval int `json:"monitorInterval"` + RequestVersion string `json:"sendVersion"` + RequestMethod string `json:"sendType"` + ResponseStatusCodes string `json:"receiveCode"` + ResponseData string `json:"receiveData"` + RequestURL string `json:"monitorDestination"` + RequestBody string `json:"sendData"` + AliasPort int `json:"aliasPort"` + RiseCount int `json:"riseCount"` + FallCount int `json:"fallCount"` + DataLength int `json:"dataLength"` + MaxFail int `json:"maxRetry"` + TfHttpConfig *CreateHttpMonitorConfig `json:"-" tf:"http_monitor,sub"` + TfHttpsConfig *CreateHttpsMonitorConfig `json:"-" tf:"https_monitor,sub"` + TfIcmpConfig *CreateIcmpMonitorConfig `json:"-" tf:"icmp_monitor,sub"` + TfPassiveConfig *CreatePassiveMonitorConfig `json:"-" tf:"passive_monitor,sub"` + TfTcpConfig *CreateTcpMonitorConfig `json:"-" tf:"tcp_monitor,sub"` + TfUdpConfig *CreateUdpMonitorConfig `json:"-" tf:"udp_monitor,sub"` +} + +type CreateHttpMonitorConfig struct { + Timeout int `json:"-" tf:"timeout"` + Interval int `json:"-" tf:"interval"` + RequestVersion string `json:"-" tf:"request_version"` + RequestMethod string `json:"-" tf:"request_method"` + ResponseStatusCodes string `json:"-" tf:"response_status_codes"` + ResponseData string `json:"-" tf:"response_data"` + RequestURL string `json:"-" tf:"request_url"` + RequestBody string `json:"-" tf:"request_body"` + AliasPort int `json:"-" tf:"monitor_port"` + RiseCount int `json:"-" tf:"rise_count"` + FallCount int `json:"-" tf:"fall_count"` +} + +type CreateHttpsMonitorConfig struct { + Timeout int `json:"monitorTimeout" tf:"timeout"` + Interval int `json:"monitorInterval" tf:"interval"` + RequestVersion string `json:"sendVersion" tf:"request_version"` + RequestMethod string `json:"sendType" tf:"request_method"` + ResponseStatusCodes string `json:"receiveCode" tf:"response_status_codes"` + ResponseData string `json:"receiveData" tf:"response_data"` + RequestURL string `json:"monitorDestination" tf:"request_url"` + RequestBody string `json:"sendData" tf:"request_body"` + AliasPort int `json:"aliasPort" tf:"monitor_port"` + RiseCount int `json:"riseCount" tf:"rise_count"` + FallCount int `json:"fallCount" tf:"fall_count"` +} + +type CreateIcmpMonitorConfig struct { + FallCount int `json:"fallCount" tf:"fall_count"` + Interval int `json:"monitorInterval" tf:"interval"` + AliasPort int `json:"aliasPort" tf:"monitor_port"` + RiseCount int `json:"riseCount" tf:"rise_count"` + DataLength int `json:"dataLength" tf:"data_length"` + Timeout int `json:"monitorTimeout" tf:"timeout"` +} + +type CreatePassiveMonitorConfig struct { + Timeout int `json:"monitorTimeout" tf:"timeout"` + MaxFail int `json:"maxRetry" tf:"max_fail"` +} + +type CreateTcpMonitorConfig struct { + FallCount int `json:"fallCount" tf:"fall_count"` + Interval int `json:"monitorInterval" tf:"interval"` + AliasPort int `json:"aliasPort" tf:"monitor_port"` + RiseCount int `json:"riseCount" tf:"rise_count"` + Timeout int `json:"monitorTimeout" tf:"timeout"` + RequestBody string `json:"sendData" tf:"request_body"` + ResponseData string `json:"receiveData" tf:"response_data"` +} + +type CreateUdpMonitorConfig struct { + FallCount int `json:"fallCount" tf:"fall_count"` + Interval int `json:"monitorInterval" tf:"interval"` + AliasPort int `json:"aliasPort" tf:"monitor_port"` + RiseCount int `json:"riseCount" tf:"rise_count"` + Timeout int `json:"monitorTimeout" tf:"timeout"` + RequestBody string `json:"sendData" tf:"request_body"` + ResponseData string `json:"receiveData" tf:"response_data"` } // Create LB Monitor Resp @@ -163,30 +240,29 @@ type CreateLBMonitorResp struct { } type LBMonitorResp struct { - ID int `json:"id"` - Name string `json:"name"` - Visibility string `json:"visibility"` - Description string `json:"description"` - MonitorType string `json:"monitorType"` - MonitorInterval int `json:"monitorInterval"` - MonitorTimeout int `json:"monitorTimeout"` - SendVersion string `json:"sendVersion"` - SendType string `json:"sendType"` - ReceiveCode string `json:"receiveCode"` - MonitorDestination string `json:"monitorDestination"` - MonitorReverse bool `json:"monitorReverse"` - MonitorTransparent bool `json:"monitorTransparent"` - MonitorAdaptive bool `json:"monitorAdaptive"` - AliasPort int `json:"aliasPort"` - InternalID string `json:"internalId"` - MonitorSource string `json:"monitorSource"` - Status string `json:"status"` - Enabled bool `json:"enabled"` - FallCount int `json:"fallCount"` - RiseCount int `json:"riseCount"` - DateCreated string `json:"dateCreated"` - LastUpdated string `json:"lastUpdated"` - LoadBalancer LBMonitor `json:"loadBalancer"` + ID int `json:"id" tf:"id,computed"` + Name string `json:"name"` + Visibility string `json:"visibility"` + Description string `json:"description"` + Timeout int `json:"monitorTimeout" tf:"timeout"` + Interval int `json:"monitorInterval" tf:"interval"` + RequestVersion string `json:"sendVersion" tf:"request_version"` + RequestMethod string `json:"sendType" tf:"request_method"` + ResponseStatusCodes string `json:"receiveCode" tf:"response_status_codes"` + ResponseData string `json:"receiveData" tf:"response_data"` + RequestURL string `json:"monitorDestination" tf:"request_url"` + RequestBody string `json:"sendData" tf:"request_body"` + AliasPort int `json:"aliasPort" tf:"monitor_port"` + RiseCount int `json:"riseCount" tf:"rise_count"` + FallCount int `json:"fallCount" tf:"fall_count"` + DataLength int `json:"dataLength" tf:"data_length"` + InternalID string `json:"internalId"` + MonitorSource string `json:"monitorSource"` + Status string `json:"status"` + Enabled bool `json:"enabled"` + DateCreated string `json:"dateCreated"` + LastUpdated string `json:"lastUpdated"` + LoadBalancer LBMonitor `json:"loadBalancer"` } type LBMonitor struct { @@ -209,27 +285,133 @@ type CreateLBProfile struct { type CreateLBProfileReq struct { ID int `json:"-" tf:"id,computed"` - Name string `json:"name"` - Description string `json:"description"` + LbID int `json:"-" tf:"lb_id"` + Name string `json:"name" tf:"name"` + Description string `json:"description" tf:"description"` ServiceType string `json:"serviceType" tf:"service_type"` - ProfileConfig LBProfile `json:"config"` + ProfileConfig LBProfile `json:"config" tf:"config"` } type LBProfile struct { - ProfileType string `json:"profileType" tf:"profile_type"` - RequestHeaderSize int `json:"requestHeaderSize" tf:"request_header_size"` - ResponseHeaderSize int `json:"responseHeaderSize" tf:"response_header_size"` - ResponseTimeout int `json:"responseTimeout" tf:"response_timeout"` - HTTPIdleTimeoutName int `json:"httpIdleTimeout" tf:"http_idle_timeout"` - FastTCPIdleTimeout int `json:"fastTcpIdleTimeout" tf:"fast_tcp_idle_timeout"` - SSLSuite string `json:"sslSuite" tf:"ssl_suite"` + TfHttpConfig *CreateHttpProfileConfig `json:"-" tf:"http_monitor,sub"` + TfTcpConfig *CreateTcpProfileConfig `json:"-" tf:"tcp_monitor,sub"` + TfUdpConfig *CreateUdpProfileConfig `json:"-" tf:"udp_profile,sub"` + TfCookieConfig *CreateCookieProfileConfig `json:"-" tf:"cookie_profile,sub"` + TfGenericConfig *CreateGenericProfileConfig `json:"-" tf:"generic_profile,sub"` + TfSourceConfig *CreateSourceProfileConfig `json:"-" tf:"sourceip_profile,sub"` + TfClientConfig *CreateClientProfileConfig `json:"-" tf:"client_profile,sub"` + TfServerConfig *CreateServerProfileConfig `json:"-" tf:"server_profile,sub"` + + ProfileType string `json:"profileType" tf:"profile_type"` + FastTCPIdleTimeout int `json:"fastTcpIdleTimeout" tf:"fast_tcp_idle_timeout"` + FastUDPIdleTimeout int `json:"fastUdpIdleTimeout" tf:"fast_udp_idle_timeout"` + HTTPIdleTimeout int `json:"httpIdleTimeout" tf:"http_idle_timeout"` + ConnectionCloseTimeout int `json:"connectionCloseTimeout" tf:"connection_close_timeout"` + HaFlowMirroring bool `json:"haFlowMirroring" tf:"ha_flow_mirroring"` + RequestHeaderSize int `json:"requestHeaderSize" tf:"request_header_size"` + ResponseHeaderSize int `json:"responseHeaderSize" tf:"response_header_size"` + HTTPsRedirect string `json:"httpsRedirect" tf:"redirection"` + XForwardedFor string `json:"xForwardedFor" tf:"x_forwarded_for"` + RequestBodySize string `json:"requestBodySize" tf:"request_body_size"` + ResponseTimeout int `json:"responseTimeout" tf:"response_timeout"` + NtlmAuthentication bool `json:"ntlmAuthentication" tf:"ntlm_authentication"` + SharePersistence bool `json:"sharePersistence" tf:"share_persistence"` + CookieName string `json:"cookieName" tf:"cookie_name"` + CookieFallback bool `json:"cookieFallback" tf:"cookie_fallback"` + CookieGarbling bool `json:"cookieGarbling" tf:"cookie_garbling"` + CookieMode string `json:"cookieMode" tf:"cookie_mode"` + CookieType string `json:"cookieType" tf:"cookie_type"` + CookieDomain string `json:"cookieDomain" tf:"cookie_domain"` + CookiePath string `json:"cookiePath" tf:"cookie_path"` + MaxIdleTime int `json:"maxIdleTime" tf:"max_idle_time"` + MaxCookieAge int `json:"maxCookieAge" tf:"max_cookie_age"` + MaxCookieLife int `json:"maxCookieLife" tf:"max_cookie_life"` + HaPersistenceMirroring bool `json:"haPersistenceMirroring" tf:"ha_persistence_mirroring"` + PersistenceEntryTimeout int `json:"persistenceEntryTimeout" tf:"persistence_entry_timeout"` + PurgeEntries bool `json:"purgeEntries" tf:"purge_entries_when_full"` + SSLSuite string `json:"sslSuite" tf:"ssl_suite"` + SessionCache bool `json:"sessionCache" tf:"session_cache"` + SessionCacheEntryTimeout int `json:"sessionCacheTimeout" tf:"session_cache_entry_timeout"` + PreferServerCipher bool `json:"preferServerCipher" tf:"prefer_server_cipher"` + Tag []Tags `json:"tags" tf:"tags"` +} + +type CreateClientProfileConfig struct { + SSLSuite string `json:"sslSuite" tf:"ssl_suite"` + SessionCache bool `json:"sessionCache" tf:"session_cache"` + ProfileType string `json:"profileType" tf:"profile_type"` + SessionCacheEntryTimeout int `json:"sessionCacheTimeout" tf:"session_cache_entry_timeout"` + PreferServerCipher bool `json:"preferServerCipher" tf:"prefer_server_cipher"` +} + +type CreateServerProfileConfig struct { + SSLSuite string `json:"sslSuite" tf:"ssl_suite"` + SessionCache bool `json:"sessionCache" tf:"session_cache"` + ProfileType string `json:"profileType" tf:"profile_type"` +} + +type CreateSourceProfileConfig struct { + HaPersistenceMirroring bool `json:"haPersistenceMirroring" tf:"ha_persistence_mirroring"` + PersistenceEntryTimeout int `json:"persistenceEntryTimeout" tf:"persistence_entry_timeout"` + PurgeEntries bool `json:"purgeEntries" tf:"purge_entries_when_full"` + ProfileType string `json:"profileType" tf:"profile_type"` + SharePersistence bool `json:"sharePersistence" tf:"share_persistence"` +} + +type CreateGenericProfileConfig struct { + ProfileType string `json:"profileType" tf:"profile_type"` + HaPersistenceMirroring bool `json:"haPersistenceMirroring" tf:"ha_persistence_mirroring"` + PersistenceEntryTimeout int `json:"persistenceEntryTimeout" tf:"persistence_entry_timeout"` + SharePersistence bool `json:"sharePersistence" tf:"share_persistence"` +} + +type CreateCookieProfileConfig struct { + CookieName string `json:"cookieName" tf:"cookie_name"` + CookieFallback bool `json:"cookieFallback" tf:"cookie_fallback"` + CookieGarbling bool `json:"cookieGarbling" tf:"cookie_garbling"` + CookieMode string `json:"cookieMode" tf:"cookie_mode"` + CookieType string `json:"cookieType" tf:"cookie_type"` + CookieDomain string `json:"cookieDomain" tf:"cookie_domain"` + CookiePath string `json:"cookiePath" tf:"cookie_path"` + MaxIdleTime int `json:"maxIdleTime" tf:"max_idle_time"` + MaxCookieAge int `json:"maxCookieAge" tf:"max_cookie_age"` + ProfileType string `json:"profileType" tf:"profile_type"` + SharePersistence bool `json:"sharePersistence" tf:"share_persistence"` + MaxCookieLife int `json:"maxCookieLife" tf:"max_cookie_life"` +} + +type CreateHttpProfileConfig struct { + HTTPIdleTimeout int `json:"httpIdleTimeout" tf:"http_idle_timeout"` + HTTPsRedirect string `json:"httpsRedirect" tf:"redirection"` + ProfileType string `json:"profileType" tf:"profile_type"` + RequestHeaderSize int `json:"requestHeaderSize" tf:"request_header_size"` + ResponseHeaderSize int `json:"responseHeaderSize" tf:"response_header_size"` + NtlmAuthentication bool `json:"ntlmAuthentication" tf:"ntlm_authentication"` + RequestBodySize string `json:"requestBodySize" tf:"request_body_size"` + ResponseTimeout int `json:"responseTimeout" tf:"response_timeout"` + XForwardedFor string `json:"xForwardedFor" tf:"x_forwarded_for"` +} + +type CreateTcpProfileConfig struct { ConnectionCloseTimeout int `json:"connectionCloseTimeout" tf:"connection_close_timeout"` + FastTCPIdleTimeout int `json:"fastTcpIdleTimeout" tf:"fast_tcp_idle_timeout"` HaFlowMirroring bool `json:"haFlowMirroring" tf:"ha_flow_mirroring"` - CookieMode string `json:"cookieMode" tf:"cookie_mode"` - CookieName string `json:"cookieName" tf:"cookie_name"` - CookieType string `json:"cookieType" tf:"cookie_type"` - CookieFallback bool `json:"cookieFallback" tf:"cookie_fallback"` - CookieGarbling bool `json:"cookieGarbling" tf:"cookie_garbling"` + ProfileType string `json:"profileType" tf:"profile_type"` +} + +type CreateUdpProfileConfig struct { + FastUDPIdleTimeout int `json:"fastUdpIdleTimeout" tf:"fast_udp_idle_timeout"` + ProfileType string `json:"profileType" tf:"profile_type"` + HaFlowMirroring bool `json:"haFlowMirroring" tf:"ha_flow_mirroring"` +} + +type Tags struct { + Tag string `json:"tag" tf:"tag"` + Scope string `json:"scope" tf:"scope"` +} +type PoolTags struct { + Tag string `json:"name" tf:"tag"` + Scope string `json:"value" tf:"scope"` } // Create LB Profile Resp @@ -239,7 +421,7 @@ type CreateLBProfileResp struct { } type LBProfileResp struct { - ID int `json:"id"` + ID int `json:"id" tf:"id,computed"` Name string `json:"name"` Category string `json:"category"` ServiceType string `json:"serviceType"` @@ -279,7 +461,8 @@ type GetLBProfile struct { } type GetLBProfilesResp struct { - ID int `json:"id"` + ID int `json:"id" tf:"id,computed"` + LbID int `json:"-" tf:"lb_id,computed"` Name string `json:"name"` Category string `json:"category"` ServiceType string `json:"serviceType"` @@ -336,28 +519,30 @@ type GetLBMonitors struct { } type GetLBMonitorsResp struct { - ID int `json:"id"` - Name string `json:"name"` - Visibility string `json:"visibility"` - Description string `json:"description"` - MonitorType string `json:"monitorType"` - MonitorInterval int `json:"monitorInterval"` - MonitorTimeout int `json:"monitorTimeout"` - MonitorReverse bool `json:"monitorReverse"` - MonitorTransparent bool `json:"monitorTransparent"` - MonitorAdaptive bool `json:"monitorAdaptive"` - InternalID string `json:"internalId"` - ExternalID string `json:"externalId"` - MonitorSource string `json:"monitorSource"` - Status string `json:"status"` - Enabled bool `json:"enabled"` - MaxRetry int `json:"maxRetry"` - FallCount int `json:"fallCount"` - RiseCount int `json:"riseCount"` - DataLength int `json:"dataLength"` - DateCreated string `json:"dateCreated"` - LastUpdated string `json:"lastUpdated"` - LoadBalancer LBMonitor `json:"loadBalancer"` + ID int `json:"id" tf:"id,computed"` + LbID int `json:"lb_id" tf:"lb_id,computed"` + Name string `json:"name"` + Visibility string `json:"visibility"` + Description string `json:"description"` + Timeout int `json:"monitorTimeout" tf:"timeout"` + Interval int `json:"monitorInterval" tf:"interval"` + RequestVersion string `json:"sendVersion" tf:"request_version"` + RequestMethod string `json:"sendType" tf:"request_method"` + ResponseStatusCodes string `json:"receiveCode" tf:"response_status_codes"` + ResponseData string `json:"receiveData" tf:"response_data"` + RequestURL string `json:"monitorDestination" tf:"request_url"` + RequestBody string `json:"sendData" tf:"request_body"` + AliasPort int `json:"aliasPort" tf:"monitor_port"` + RiseCount int `json:"riseCount" tf:"rise_count"` + FallCount int `json:"fallCount" tf:"fall_count"` + DataLength int `json:"dataLength" tf:"data_length"` + InternalID string `json:"internalId"` + MonitorSource string `json:"monitorSource"` + Status string `json:"status"` + Enabled bool `json:"enabled"` + DateCreated string `json:"dateCreated"` + LastUpdated string `json:"lastUpdated"` + LoadBalancer LBMonitor `json:"loadBalancer"` } // Get Specific LB Monitor @@ -366,30 +551,30 @@ type GetSpecificLBMonitor struct { } type GetSpecificLBMonitorResp struct { - ID int `json:"id" tf:"id,computed"` - Name string `json:"name"` - Visibility string `json:"visibility"` - Description string `json:"description"` - MonitorType string `json:"monitorType"` - MonitorInterval int `json:"monitorInterval"` - MonitorTimeout int `json:"monitorTimeout"` - SendVersion string `json:"sendVersion"` - SendType string `json:"sendType"` - ReceiveCode string `json:"receiveCode"` - MonitorReverse bool `json:"monitorReverse"` - MonitorTransparent bool `json:"monitorTransparent"` - MonitorAdaptive bool `json:"monitorAdaptive"` - InternalID string `json:"internalId"` - ExternalID string `json:"externalId"` - MonitorSource string `json:"monitorSource"` - Status string `json:"status"` - Enabled bool `json:"enabled"` - MaxRetry int `json:"maxRetry"` - FallCount int `json:"fallCount"` - RiseCount int `json:"riseCount"` - DateCreated string `json:"dateCreated"` - LastUpdated string `json:"lastUpdated"` - LoadBalancer LBMonitor `json:"loadBalancer"` + ID int `json:"-" tf:"id,computed"` + LbID int `json:"-" tf:"lb_id"` + Name string `json:"name"` + Visibility string `json:"visibility"` + Description string `json:"description"` + Timeout int `json:"monitorTimeout" tf:"timeout"` + Interval int `json:"monitorInterval" tf:"interval"` + RequestVersion string `json:"sendVersion" tf:"request_version"` + RequestMethod string `json:"sendType" tf:"request_method"` + ResponseStatusCodes string `json:"receiveCode" tf:"response_status_codes"` + ResponseData string `json:"receiveData" tf:"response_data"` + RequestURL string `json:"monitorDestination" tf:"request_url"` + RequestBody string `json:"sendData" tf:"request_body"` + AliasPort int `json:"aliasPort" tf:"monitor_port"` + RiseCount int `json:"riseCount" tf:"rise_count"` + FallCount int `json:"fallCount" tf:"fall_count"` + DataLength int `json:"dataLength" tf:"data_length"` + InternalID string `json:"internalId"` + MonitorSource string `json:"monitorSource"` + Status string `json:"status"` + Enabled bool `json:"enabled"` + DateCreated string `json:"dateCreated"` + LastUpdated string `json:"lastUpdated"` + LoadBalancer LBMonitor `json:"loadBalancer"` } // Create LB Pool @@ -398,12 +583,14 @@ type CreateLBPool struct { } type CreateLBPoolReq struct { - ID int `json:"id" tf:"id,computed"` - Name string `json:"name"` - Description string `json:"description"` - VipBalance string `json:"vipBalance" tf:"vip_balance"` - MinActive int `json:"minActive" tf:"min_active"` - PoolConfig PoolConfig `json:"config"` + ID int `json:"id" tf:"id,computed"` + LbID int `json:"-" tf:"lb_id"` + Name string `json:"name" tf:"name"` + Description string `json:"description" tf:"description"` + VipBalance string `json:"vipBalance" tf:"algorithm"` + MinActive int `json:"minActive" tf:"min_active_members"` + PoolConfig *PoolConfig `json:"config" tf:"config,sub"` + Tag []PoolTags `json:"tags" tf:"tags,sub"` } type PoolConfig struct { @@ -417,8 +604,8 @@ type PoolConfig struct { } type MemberGroup struct { - Name string `json:"name"` - Path string `json:"path"` + Group string `json:"group" tf:"group"` + MaxIpListSize int `json:"maxIpListSize" tf:"max_ip_list_size"` IPRevisionFilter string `json:"ipRevisionFilter" tf:"ip_revision_filter"` Port int `json:"port"` } @@ -430,41 +617,32 @@ type CreateLBPoolResp struct { } type LBPoolResp struct { - ID int `json:"id"` - Name string `json:"name"` - Category string `json:"category"` - Visibility string `json:"visibility"` - Description string `json:"description"` - InternalID string `json:"internalId"` - ExternalID string `json:"externalId"` - Enabled bool `json:"enabled"` - VipBalance string `json:"vipBalance"` - MinActive int `json:"minActive"` - NumberActive int `json:"numberActive"` - NumberInService int `json:"numberInService"` - HealthScore float32 `json:"healthScore"` - PerformanceScore float32 `json:"performanceScore"` - HealthPenalty float32 `json:"healthPenalty"` - SecurityPenalty float32 `json:"securityPenalty"` - ErrorPenalty float32 `json:"errorPenalty"` - Status string `json:"status"` - DateCreated string `json:"dateCreated"` - LastUpdated string `json:"lastUpdated"` - Nodes []string `json:"nodes"` - Monitors []string `json:"monitors"` - Members []string `json:"members"` - LoadBalancer LBMonitor `json:"loadBalancer"` - LBPoolConfig LBPoolConfig `json:"config"` -} - -type LBPoolConfig struct { - SnatIPAddresses []string `json:"snatIpAddresses"` - TCPMultiplexingNumber int `json:"tcpMultiplexingNumber"` - PassiveMonitorPath int `json:"passiveMonitorPath"` - TCPMultiplexing bool `json:"tcpMultiplexing"` - SnatIPAddress string `json:"snatIpAddress"` - SnatTranslationType string `json:"snatTranslationType"` - MemberGroup MemberGroup `json:"memberGroup"` + ID int `json:"id" tf:"id,computed"` + LbID int `json:"lb_id" tf:"lb_id"` + Name string `json:"name"` + Category string `json:"category"` + Visibility string `json:"visibility"` + Description string `json:"description"` + InternalID string `json:"internalId"` + ExternalID string `json:"externalId"` + Enabled bool `json:"enabled"` + VipBalance string `json:"vipBalance"` + MinActive int `json:"minActive"` + NumberActive int `json:"numberActive"` + NumberInService int `json:"numberInService"` + HealthScore float32 `json:"healthScore"` + PerformanceScore float32 `json:"performanceScore"` + HealthPenalty float32 `json:"healthPenalty"` + SecurityPenalty float32 `json:"securityPenalty"` + ErrorPenalty float32 `json:"errorPenalty"` + Status string `json:"status"` + DateCreated string `json:"dateCreated"` + LastUpdated string `json:"lastUpdated"` + Nodes []string `json:"nodes"` + Monitors []string `json:"monitors"` + Members []string `json:"members"` + LoadBalancer LBMonitor `json:"loadBalancer"` + LBPoolConfig PoolConfig `json:"config" tf:"config"` } // Get LB Pools @@ -473,31 +651,32 @@ type GetLBPools struct { } type GetLBPoolsResp struct { - ID int `json:"id"` - Name string `json:"name"` - Visibility string `json:"visibility"` - Description string `json:"description"` - InternalID string `json:"internalId"` - ExternalID string `json:"externalId"` - Enabled bool `json:"enabled"` - VipBalance string `json:"vipBalance"` - MinActive int `json:"minActive"` - NumberActive int `json:"numberActive"` - NumberInService int `json:"numberInService"` - HealthScore float32 `json:"healthScore"` - PerformanceScore float32 `json:"performanceScore"` - HealthPenalty float32 `json:"healthPenalty"` - SecurityPenalty float32 `json:"securityPenalty"` - ErrorPenalty float32 `json:"errorPenalty"` - Status string `json:"status"` - DateCreated string `json:"dateCreated"` - LastUpdated string `json:"lastUpdated"` - Nodes []string `json:"nodes"` - Monitors []string `json:"monitors"` - Members []string `json:"members"` - LoadBalancer LBMonitor `json:"loadBalancer"` - LBPoolConfig LBPoolConfig `json:"config"` - Meta MetaInfo `json:"meta"` + ID int `json:"id" tf:"id,computed"` + LbID int `json:"-" tf:"lb_id,computed"` + Name string `json:"name"` + Visibility string `json:"visibility"` + Description string `json:"description"` + InternalID string `json:"internalId"` + ExternalID string `json:"externalId"` + Enabled bool `json:"enabled"` + VipBalance string `json:"vipBalance"` + MinActive int `json:"minActive"` + NumberActive int `json:"numberActive"` + NumberInService int `json:"numberInService"` + HealthScore float32 `json:"healthScore"` + PerformanceScore float32 `json:"performanceScore"` + HealthPenalty float32 `json:"healthPenalty"` + SecurityPenalty float32 `json:"securityPenalty"` + ErrorPenalty float32 `json:"errorPenalty"` + Status string `json:"status"` + DateCreated string `json:"dateCreated"` + LastUpdated string `json:"lastUpdated"` + Nodes []string `json:"nodes"` + Monitors []string `json:"monitors"` + Members []string `json:"members"` + LoadBalancer LBMonitor `json:"loadBalancer"` + LBPoolConfig PoolConfig `json:"config" tf:"config"` + Meta MetaInfo `json:"meta"` } // Get Specific LB Pools @@ -506,30 +685,31 @@ type GetSpecificLBPool struct { } type GetSpecificLBPoolResp struct { - ID int `json:"-" tf:"id,computed"` - Name string `json:"name"` - Visibility string `json:"visibility"` - Description string `json:"description"` - InternalID string `json:"internalId"` - ExternalID string `json:"externalId"` - Enabled bool `json:"enabled"` - VipBalance string `json:"vipBalance"` - MinActive int `json:"minActive"` - NumberActive int `json:"numberActive"` - NumberInService int `json:"numberInService"` - HealthScore float32 `json:"healthScore"` - PerformanceScore float32 `json:"performanceScore"` - HealthPenalty float32 `json:"healthPenalty"` - SecurityPenalty float32 `json:"securityPenalty"` - ErrorPenalty float32 `json:"errorPenalty"` - Status string `json:"status"` - DateCreated string `json:"dateCreated"` - LastUpdated string `json:"lastUpdated"` - Nodes []string `json:"nodes"` - Monitors []string `json:"monitors"` - Members []string `json:"members"` - LoadBalancer LBMonitor `json:"loadBalancer"` - LBPoolConfig LBPoolConfig `json:"config"` + ID int `json:"-" tf:"id,computed"` + LbID int `json:"-" tf:"lb_id,computed"` + Name string `json:"name"` + Visibility string `json:"visibility"` + Description string `json:"description"` + InternalID string `json:"internalId"` + ExternalID string `json:"externalId"` + Enabled bool `json:"enabled"` + VipBalance string `json:"vipBalance"` + MinActive int `json:"minActive"` + NumberActive int `json:"numberActive"` + NumberInService int `json:"numberInService"` + HealthScore float32 `json:"healthScore"` + PerformanceScore float32 `json:"performanceScore"` + HealthPenalty float32 `json:"healthPenalty"` + SecurityPenalty float32 `json:"securityPenalty"` + ErrorPenalty float32 `json:"errorPenalty"` + Status string `json:"status"` + DateCreated string `json:"dateCreated"` + LastUpdated string `json:"lastUpdated"` + Nodes []string `json:"nodes"` + Monitors []string `json:"monitors"` + Members []string `json:"members"` + LoadBalancer LBMonitor `json:"loadBalancer"` + LBPoolConfig PoolConfig `json:"config" tf:"config"` } // CREATE LB Virtual servers @@ -539,24 +719,26 @@ type CreateLBVirtualServers struct { } type CreateLBVirtualServersReq struct { - ID int `json:"id" tf:"id,computed"` - Description string `json:"description"` - VipName string `json:"vipName" tf:"vip_name"` - VipAddress string `json:"vipAddress" tf:"vip_address"` - VipProtocol string `json:"vipProtocol" tf:"vip_protocol"` - VipPort string `json:"vipPort" tf:"vip_port"` - Pool int `json:"pool"` - SSLServerCert int `json:"sslServerCert" tf:"ssl_server_cert"` - SSLCert int `json:"sslCert" tf:"ssl_cert"` - VirtualServerConfig VirtualServerConfig `json:"config"` + ID int `json:"id" tf:"id,computed"` + LbID int `json:"-" tf:"lb_id"` + Description string `json:"description" tf:"description"` + VipName string `json:"vipName" tf:"name"` + VipAddress string `json:"vipAddress" tf:"vip_address"` + VipProtocol string `json:"vipProtocol" tf:"type"` + VipPort string `json:"vipPort" tf:"vip_port"` + Pool int `json:"pool" tf:"pool"` + VipHostName string `json:"vipHostName" tf:"vip_host_name"` + SSLServerCert int `json:"sslServerCert" tf:"ssl_server_cert"` + SSLCert int `json:"sslCert" tf:"ssl_client_cert"` + VirtualServerConfig *VirtualServerConfig `json:"config" tf:"config,sub"` } type VirtualServerConfig struct { - Persistence string `json:"persistence"` + Persistence string `json:"persistence" tf:"persistence"` PersistenceProfile int `json:"persistenceProfile" tf:"persistence_profile"` ApplicationProfile int `json:"applicationProfile" tf:"application_profile"` - SSLClientProfile string `json:"sslClientProfile" tf:"ssl_client_profile"` - SSLServerProfile string `json:"sslServerProfile" tf:"ssl_server_profile"` + SSLClientProfile int `json:"sslClientProfile" tf:"ssl_client_profile"` + SSLServerProfile int `json:"sslServerProfile" tf:"ssl_server_profile"` } // CREATE LB Virtual Server Resp @@ -566,7 +748,7 @@ type LBVirtualServersResp struct { } type CreateLBVirtualServersResp struct { - ID int `json:"id"` + ID int `json:"id" tf:"id,computed"` Name string `json:"name"` Description string `json:"description"` Active bool `json:"active"` @@ -629,8 +811,8 @@ type GetLBVirtualServersResp struct { type VSConfig struct { Persistence string `json:"persistence"` PersistenceProfile int `json:"persistenceProfile"` - SslServerProfile string `json:"sslServerProfile"` - SslClientProfile string `json:"sslClientProfile"` + SslServerProfile int `json:"sslServerProfile"` + SslClientProfile int `json:"sslClientProfile"` ApplicationProfile int `json:"applicationProfile"` Monitors []string `json:"monitors"` } From 1b644d07296a5e39fb679e6c40dfb993843f5f4e Mon Sep 17 00:00:00 2001 From: Pushpalatha555 Date: Mon, 25 Jul 2022 11:25:21 +0530 Subject: [PATCH 2/4] addressed the comments --- pkg/models/load_balancer.go | 104 ++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 53 deletions(-) diff --git a/pkg/models/load_balancer.go b/pkg/models/load_balancer.go index f611bb5..6be0f67 100644 --- a/pkg/models/load_balancer.go +++ b/pkg/models/load_balancer.go @@ -21,13 +21,13 @@ type CreateNetworkLoadBalancerRequest struct { } type EnableResourcePermissions struct { - All bool `json:"all,omitempty" tf:"all"` - Sites []PermissionSites `json:"sites,omitempty" tf:"sites"` + All bool `json:"all" tf:"all"` + Sites []PermissionSites `json:"sites" tf:"sites"` } type PermissionSites struct { - ID int `json:"id,omitempty" tf:"id"` - Default bool `json:"default,omitempty" tf:"default"` + ID int `json:"id" tf:"id"` + Default bool `json:"default" tf:"default"` } type CreateConfig struct { @@ -57,7 +57,6 @@ type CreateNetworkLoadBalancerResp struct { type NetworkLoadBalancerResp struct { ID int `json:"id" tf:"id,computed"` - LbID int `json:"lb_id" tf:"lb_id,computed"` Name string `json:"name"` AccountID int `json:"accountId"` Cloud CloudInfo `json:"cloud"` @@ -90,7 +89,6 @@ type GetNetworkLoadBalancers struct { type GetNetworkLoadBalancerResp struct { ID int `json:"id" tf:"id,computed"` - LbID int `json:"lb_id" tf:"lb_id,computed"` Name string `json:"name"` AccountID int `json:"accountId"` Cloud CloudInfo `json:"cloud"` @@ -240,29 +238,30 @@ type CreateLBMonitorResp struct { } type LBMonitorResp struct { - ID int `json:"id" tf:"id,computed"` - Name string `json:"name"` - Visibility string `json:"visibility"` - Description string `json:"description"` - Timeout int `json:"monitorTimeout" tf:"timeout"` - Interval int `json:"monitorInterval" tf:"interval"` - RequestVersion string `json:"sendVersion" tf:"request_version"` - RequestMethod string `json:"sendType" tf:"request_method"` - ResponseStatusCodes string `json:"receiveCode" tf:"response_status_codes"` - ResponseData string `json:"receiveData" tf:"response_data"` - RequestURL string `json:"monitorDestination" tf:"request_url"` - RequestBody string `json:"sendData" tf:"request_body"` - AliasPort int `json:"aliasPort" tf:"monitor_port"` - RiseCount int `json:"riseCount" tf:"rise_count"` - FallCount int `json:"fallCount" tf:"fall_count"` - DataLength int `json:"dataLength" tf:"data_length"` - InternalID string `json:"internalId"` - MonitorSource string `json:"monitorSource"` - Status string `json:"status"` - Enabled bool `json:"enabled"` - DateCreated string `json:"dateCreated"` - LastUpdated string `json:"lastUpdated"` - LoadBalancer LBMonitor `json:"loadBalancer"` + ID int `json:"id"` + Name string `json:"name"` + Visibility string `json:"visibility"` + Description string `json:"description"` + MonitorType string `json:"monitorType"` + MonitorInterval int `json:"monitorInterval"` + MonitorTimeout int `json:"monitorTimeout"` + SendVersion string `json:"sendVersion"` + SendType string `json:"sendType"` + ReceiveCode string `json:"receiveCode"` + MonitorDestination string `json:"monitorDestination"` + MonitorReverse bool `json:"monitorReverse"` + MonitorTransparent bool `json:"monitorTransparent"` + MonitorAdaptive bool `json:"monitorAdaptive"` + AliasPort int `json:"aliasPort"` + InternalID string `json:"internalId"` + MonitorSource string `json:"monitorSource"` + Status string `json:"status"` + Enabled bool `json:"enabled"` + FallCount int `json:"fallCount"` + RiseCount int `json:"riseCount"` + DateCreated string `json:"dateCreated"` + LastUpdated string `json:"lastUpdated"` + LoadBalancer LBMonitor `json:"loadBalancer"` } type LBMonitor struct { @@ -519,30 +518,29 @@ type GetLBMonitors struct { } type GetLBMonitorsResp struct { - ID int `json:"id" tf:"id,computed"` - LbID int `json:"lb_id" tf:"lb_id,computed"` - Name string `json:"name"` - Visibility string `json:"visibility"` - Description string `json:"description"` - Timeout int `json:"monitorTimeout" tf:"timeout"` - Interval int `json:"monitorInterval" tf:"interval"` - RequestVersion string `json:"sendVersion" tf:"request_version"` - RequestMethod string `json:"sendType" tf:"request_method"` - ResponseStatusCodes string `json:"receiveCode" tf:"response_status_codes"` - ResponseData string `json:"receiveData" tf:"response_data"` - RequestURL string `json:"monitorDestination" tf:"request_url"` - RequestBody string `json:"sendData" tf:"request_body"` - AliasPort int `json:"aliasPort" tf:"monitor_port"` - RiseCount int `json:"riseCount" tf:"rise_count"` - FallCount int `json:"fallCount" tf:"fall_count"` - DataLength int `json:"dataLength" tf:"data_length"` - InternalID string `json:"internalId"` - MonitorSource string `json:"monitorSource"` - Status string `json:"status"` - Enabled bool `json:"enabled"` - DateCreated string `json:"dateCreated"` - LastUpdated string `json:"lastUpdated"` - LoadBalancer LBMonitor `json:"loadBalancer"` + ID int `json:"id" tf:"id,computed"` + LbID int `json:"lb_id" tf:"lb_id,computed"` + Name string `json:"name"` + Visibility string `json:"visibility"` + Description string `json:"description"` + MonitorType string `json:"monitorType"` + MonitorInterval int `json:"monitorInterval"` + MonitorTimeout int `json:"monitorTimeout"` + MonitorReverse bool `json:"monitorReverse"` + MonitorTransparent bool `json:"monitorTransparent"` + MonitorAdaptive bool `json:"monitorAdaptive"` + InternalID string `json:"internalId"` + ExternalID string `json:"externalId"` + MonitorSource string `json:"monitorSource"` + Status string `json:"status"` + Enabled bool `json:"enabled"` + MaxRetry int `json:"maxRetry"` + FallCount int `json:"fallCount"` + RiseCount int `json:"riseCount"` + DataLength int `json:"dataLength"` + DateCreated string `json:"dateCreated"` + LastUpdated string `json:"lastUpdated"` + LoadBalancer LBMonitor `json:"loadBalancer"` } // Get Specific LB Monitor From 10a40601152c74b6fc85fe46351a1f45cc84c97e Mon Sep 17 00:00:00 2001 From: Pushpalatha555 Date: Mon, 25 Jul 2022 13:24:59 +0530 Subject: [PATCH 3/4] addressed the comments --- pkg/models/load_balancer.go | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/pkg/models/load_balancer.go b/pkg/models/load_balancer.go index 6be0f67..9339d2c 100644 --- a/pkg/models/load_balancer.go +++ b/pkg/models/load_balancer.go @@ -283,24 +283,23 @@ type CreateLBProfile struct { } type CreateLBProfileReq struct { - ID int `json:"-" tf:"id,computed"` - LbID int `json:"-" tf:"lb_id"` - Name string `json:"name" tf:"name"` - Description string `json:"description" tf:"description"` - ServiceType string `json:"serviceType" tf:"service_type"` - ProfileConfig LBProfile `json:"config" tf:"config"` -} - -type LBProfile struct { - TfHttpConfig *CreateHttpProfileConfig `json:"-" tf:"http_monitor,sub"` - TfTcpConfig *CreateTcpProfileConfig `json:"-" tf:"tcp_monitor,sub"` + ID int `json:"-" tf:"id,computed"` + LbID int `json:"-" tf:"lb_id"` + Name string `json:"name" tf:"name"` + Description string `json:"description" tf:"description"` + ServiceType string `json:"serviceType" tf:"service_type"` + TfHttpConfig *CreateHttpProfileConfig `json:"-" tf:"http_profile,sub"` + TfTcpConfig *CreateTcpProfileConfig `json:"-" tf:"tcp_profile,sub"` TfUdpConfig *CreateUdpProfileConfig `json:"-" tf:"udp_profile,sub"` TfCookieConfig *CreateCookieProfileConfig `json:"-" tf:"cookie_profile,sub"` TfGenericConfig *CreateGenericProfileConfig `json:"-" tf:"generic_profile,sub"` TfSourceConfig *CreateSourceProfileConfig `json:"-" tf:"sourceip_profile,sub"` TfClientConfig *CreateClientProfileConfig `json:"-" tf:"client_profile,sub"` TfServerConfig *CreateServerProfileConfig `json:"-" tf:"server_profile,sub"` + ProfileConfig LBProfile `json:"config" tf:"config,sub"` +} +type LBProfile struct { ProfileType string `json:"profileType" tf:"profile_type"` FastTCPIdleTimeout int `json:"fastTcpIdleTimeout" tf:"fast_tcp_idle_timeout"` FastUDPIdleTimeout int `json:"fastUdpIdleTimeout" tf:"fast_udp_idle_timeout"` @@ -332,7 +331,7 @@ type LBProfile struct { SessionCache bool `json:"sessionCache" tf:"session_cache"` SessionCacheEntryTimeout int `json:"sessionCacheTimeout" tf:"session_cache_entry_timeout"` PreferServerCipher bool `json:"preferServerCipher" tf:"prefer_server_cipher"` - Tag []Tags `json:"tags" tf:"tags"` + Tag []Tags `json:"tags" tf:"tags,sub"` } type CreateClientProfileConfig struct { From dc7c774359ce2026ca8df4045303b2b710436bb0 Mon Sep 17 00:00:00 2001 From: Pushpalatha555 Date: Mon, 25 Jul 2022 13:52:32 +0530 Subject: [PATCH 4/4] removed the unused keys --- pkg/models/load_balancer.go | 244 ++++++++++++++++++------------------ 1 file changed, 122 insertions(+), 122 deletions(-) diff --git a/pkg/models/load_balancer.go b/pkg/models/load_balancer.go index 9339d2c..0c65041 100644 --- a/pkg/models/load_balancer.go +++ b/pkg/models/load_balancer.go @@ -184,51 +184,51 @@ type CreateHttpMonitorConfig struct { } type CreateHttpsMonitorConfig struct { - Timeout int `json:"monitorTimeout" tf:"timeout"` - Interval int `json:"monitorInterval" tf:"interval"` - RequestVersion string `json:"sendVersion" tf:"request_version"` - RequestMethod string `json:"sendType" tf:"request_method"` - ResponseStatusCodes string `json:"receiveCode" tf:"response_status_codes"` - ResponseData string `json:"receiveData" tf:"response_data"` - RequestURL string `json:"monitorDestination" tf:"request_url"` - RequestBody string `json:"sendData" tf:"request_body"` - AliasPort int `json:"aliasPort" tf:"monitor_port"` - RiseCount int `json:"riseCount" tf:"rise_count"` - FallCount int `json:"fallCount" tf:"fall_count"` + Timeout int `json:"-" tf:"timeout"` + Interval int `json:"-" tf:"interval"` + RequestVersion string `json:"-" tf:"request_version"` + RequestMethod string `json:"-" tf:"request_method"` + ResponseStatusCodes string `json:"-" tf:"response_status_codes"` + ResponseData string `json:"-" tf:"response_data"` + RequestURL string `json:"-" tf:"request_url"` + RequestBody string `json:"-" tf:"request_body"` + AliasPort int `json:"-" tf:"monitor_port"` + RiseCount int `json:"-" tf:"rise_count"` + FallCount int `json:"-" tf:"fall_count"` } type CreateIcmpMonitorConfig struct { - FallCount int `json:"fallCount" tf:"fall_count"` - Interval int `json:"monitorInterval" tf:"interval"` - AliasPort int `json:"aliasPort" tf:"monitor_port"` - RiseCount int `json:"riseCount" tf:"rise_count"` - DataLength int `json:"dataLength" tf:"data_length"` - Timeout int `json:"monitorTimeout" tf:"timeout"` + FallCount int `json:"-" tf:"fall_count"` + Interval int `json:"-" tf:"interval"` + AliasPort int `json:"-" tf:"monitor_port"` + RiseCount int `json:"-" tf:"rise_count"` + DataLength int `json:"-" tf:"data_length"` + Timeout int `json:"-" tf:"timeout"` } type CreatePassiveMonitorConfig struct { - Timeout int `json:"monitorTimeout" tf:"timeout"` - MaxFail int `json:"maxRetry" tf:"max_fail"` + Timeout int `json:"-" tf:"timeout"` + MaxFail int `json:"-" tf:"max_fail"` } type CreateTcpMonitorConfig struct { - FallCount int `json:"fallCount" tf:"fall_count"` - Interval int `json:"monitorInterval" tf:"interval"` - AliasPort int `json:"aliasPort" tf:"monitor_port"` - RiseCount int `json:"riseCount" tf:"rise_count"` - Timeout int `json:"monitorTimeout" tf:"timeout"` - RequestBody string `json:"sendData" tf:"request_body"` - ResponseData string `json:"receiveData" tf:"response_data"` + FallCount int `json:"-" tf:"fall_count"` + Interval int `json:"-" tf:"interval"` + AliasPort int `json:"-" tf:"monitor_port"` + RiseCount int `json:"-" tf:"rise_count"` + Timeout int `json:"-" tf:"timeout"` + RequestBody string `json:"-" tf:"request_body"` + ResponseData string `json:"-" tf:"response_data"` } type CreateUdpMonitorConfig struct { - FallCount int `json:"fallCount" tf:"fall_count"` - Interval int `json:"monitorInterval" tf:"interval"` - AliasPort int `json:"aliasPort" tf:"monitor_port"` - RiseCount int `json:"riseCount" tf:"rise_count"` - Timeout int `json:"monitorTimeout" tf:"timeout"` - RequestBody string `json:"sendData" tf:"request_body"` - ResponseData string `json:"receiveData" tf:"response_data"` + FallCount int `json:"-" tf:"fall_count"` + Interval int `json:"-" tf:"interval"` + AliasPort int `json:"-" tf:"monitor_port"` + RiseCount int `json:"-" tf:"rise_count"` + Timeout int `json:"-" tf:"timeout"` + RequestBody string `json:"-" tf:"request_body"` + ResponseData string `json:"-" tf:"response_data"` } // Create LB Monitor Resp @@ -300,107 +300,107 @@ type CreateLBProfileReq struct { } type LBProfile struct { - ProfileType string `json:"profileType" tf:"profile_type"` - FastTCPIdleTimeout int `json:"fastTcpIdleTimeout" tf:"fast_tcp_idle_timeout"` - FastUDPIdleTimeout int `json:"fastUdpIdleTimeout" tf:"fast_udp_idle_timeout"` - HTTPIdleTimeout int `json:"httpIdleTimeout" tf:"http_idle_timeout"` - ConnectionCloseTimeout int `json:"connectionCloseTimeout" tf:"connection_close_timeout"` - HaFlowMirroring bool `json:"haFlowMirroring" tf:"ha_flow_mirroring"` - RequestHeaderSize int `json:"requestHeaderSize" tf:"request_header_size"` - ResponseHeaderSize int `json:"responseHeaderSize" tf:"response_header_size"` - HTTPsRedirect string `json:"httpsRedirect" tf:"redirection"` - XForwardedFor string `json:"xForwardedFor" tf:"x_forwarded_for"` - RequestBodySize string `json:"requestBodySize" tf:"request_body_size"` - ResponseTimeout int `json:"responseTimeout" tf:"response_timeout"` - NtlmAuthentication bool `json:"ntlmAuthentication" tf:"ntlm_authentication"` - SharePersistence bool `json:"sharePersistence" tf:"share_persistence"` - CookieName string `json:"cookieName" tf:"cookie_name"` - CookieFallback bool `json:"cookieFallback" tf:"cookie_fallback"` - CookieGarbling bool `json:"cookieGarbling" tf:"cookie_garbling"` - CookieMode string `json:"cookieMode" tf:"cookie_mode"` - CookieType string `json:"cookieType" tf:"cookie_type"` - CookieDomain string `json:"cookieDomain" tf:"cookie_domain"` - CookiePath string `json:"cookiePath" tf:"cookie_path"` - MaxIdleTime int `json:"maxIdleTime" tf:"max_idle_time"` - MaxCookieAge int `json:"maxCookieAge" tf:"max_cookie_age"` - MaxCookieLife int `json:"maxCookieLife" tf:"max_cookie_life"` - HaPersistenceMirroring bool `json:"haPersistenceMirroring" tf:"ha_persistence_mirroring"` - PersistenceEntryTimeout int `json:"persistenceEntryTimeout" tf:"persistence_entry_timeout"` - PurgeEntries bool `json:"purgeEntries" tf:"purge_entries_when_full"` - SSLSuite string `json:"sslSuite" tf:"ssl_suite"` - SessionCache bool `json:"sessionCache" tf:"session_cache"` - SessionCacheEntryTimeout int `json:"sessionCacheTimeout" tf:"session_cache_entry_timeout"` - PreferServerCipher bool `json:"preferServerCipher" tf:"prefer_server_cipher"` - Tag []Tags `json:"tags" tf:"tags,sub"` + ProfileType string `json:"profileType"` + FastTCPIdleTimeout int `json:"fastTcpIdleTimeout"` + FastUDPIdleTimeout int `json:"fastUdpIdleTimeout"` + HTTPIdleTimeout int `json:"httpIdleTimeout"` + ConnectionCloseTimeout int `json:"connectionCloseTimeout"` + HaFlowMirroring bool `json:"haFlowMirroring"` + RequestHeaderSize int `json:"requestHeaderSize"` + ResponseHeaderSize int `json:"responseHeaderSize"` + HTTPsRedirect string `json:"httpsRedirect"` + XForwardedFor string `json:"xForwardedFor"` + RequestBodySize string `json:"requestBodySize"` + ResponseTimeout int `json:"responseTimeout"` + NtlmAuthentication bool `json:"ntlmAuthentication"` + SharePersistence bool `json:"sharePersistence"` + CookieName string `json:"cookieName"` + CookieFallback bool `json:"cookieFallback"` + CookieGarbling bool `json:"cookieGarbling"` + CookieMode string `json:"cookieMode"` + CookieType string `json:"cookieType"` + CookieDomain string `json:"cookieDomain"` + CookiePath string `json:"cookiePath"` + MaxIdleTime int `json:"maxIdleTime"` + MaxCookieAge int `json:"maxCookieAge"` + MaxCookieLife int `json:"maxCookieLife"` + HaPersistenceMirroring bool `json:"haPersistenceMirroring"` + PersistenceEntryTimeout int `json:"persistenceEntryTimeout"` + PurgeEntries bool `json:"purgeEntries"` + SSLSuite string `json:"sslSuite"` + SessionCache bool `json:"sessionCache"` + SessionCacheEntryTimeout int `json:"sessionCacheTimeout"` + PreferServerCipher bool `json:"preferServerCipher"` + Tag []Tags `json:"tags" tf:"tags"` } type CreateClientProfileConfig struct { - SSLSuite string `json:"sslSuite" tf:"ssl_suite"` - SessionCache bool `json:"sessionCache" tf:"session_cache"` - ProfileType string `json:"profileType" tf:"profile_type"` - SessionCacheEntryTimeout int `json:"sessionCacheTimeout" tf:"session_cache_entry_timeout"` - PreferServerCipher bool `json:"preferServerCipher" tf:"prefer_server_cipher"` + SSLSuite string `json:"-" tf:"ssl_suite"` + SessionCache bool `json:"-" tf:"session_cache"` + ProfileType string `json:"-" tf:"profile_type"` + SessionCacheEntryTimeout int `json:"-" tf:"session_cache_entry_timeout"` + PreferServerCipher bool `json:"-" tf:"prefer_server_cipher"` } type CreateServerProfileConfig struct { - SSLSuite string `json:"sslSuite" tf:"ssl_suite"` - SessionCache bool `json:"sessionCache" tf:"session_cache"` - ProfileType string `json:"profileType" tf:"profile_type"` + SSLSuite string `json:"-" tf:"ssl_suite"` + SessionCache bool `json:"-" tf:"session_cache"` + ProfileType string `json:"-" tf:"profile_type"` } type CreateSourceProfileConfig struct { - HaPersistenceMirroring bool `json:"haPersistenceMirroring" tf:"ha_persistence_mirroring"` - PersistenceEntryTimeout int `json:"persistenceEntryTimeout" tf:"persistence_entry_timeout"` - PurgeEntries bool `json:"purgeEntries" tf:"purge_entries_when_full"` - ProfileType string `json:"profileType" tf:"profile_type"` - SharePersistence bool `json:"sharePersistence" tf:"share_persistence"` + HaPersistenceMirroring bool `json:"-" tf:"ha_persistence_mirroring"` + PersistenceEntryTimeout int `json:"-" tf:"persistence_entry_timeout"` + PurgeEntries bool `json:"-" tf:"purge_entries_when_full"` + ProfileType string `json:"-" tf:"profile_type"` + SharePersistence bool `json:"-" tf:"share_persistence"` } type CreateGenericProfileConfig struct { - ProfileType string `json:"profileType" tf:"profile_type"` - HaPersistenceMirroring bool `json:"haPersistenceMirroring" tf:"ha_persistence_mirroring"` - PersistenceEntryTimeout int `json:"persistenceEntryTimeout" tf:"persistence_entry_timeout"` - SharePersistence bool `json:"sharePersistence" tf:"share_persistence"` + ProfileType string `json:"-" tf:"profile_type"` + HaPersistenceMirroring bool `json:"-" tf:"ha_persistence_mirroring"` + PersistenceEntryTimeout int `json:"-" tf:"persistence_entry_timeout"` + SharePersistence bool `json:"-" tf:"share_persistence"` } type CreateCookieProfileConfig struct { - CookieName string `json:"cookieName" tf:"cookie_name"` - CookieFallback bool `json:"cookieFallback" tf:"cookie_fallback"` - CookieGarbling bool `json:"cookieGarbling" tf:"cookie_garbling"` - CookieMode string `json:"cookieMode" tf:"cookie_mode"` - CookieType string `json:"cookieType" tf:"cookie_type"` - CookieDomain string `json:"cookieDomain" tf:"cookie_domain"` - CookiePath string `json:"cookiePath" tf:"cookie_path"` - MaxIdleTime int `json:"maxIdleTime" tf:"max_idle_time"` - MaxCookieAge int `json:"maxCookieAge" tf:"max_cookie_age"` - ProfileType string `json:"profileType" tf:"profile_type"` - SharePersistence bool `json:"sharePersistence" tf:"share_persistence"` - MaxCookieLife int `json:"maxCookieLife" tf:"max_cookie_life"` + CookieName string `json:"-" tf:"cookie_name"` + CookieFallback bool `json:"-" tf:"cookie_fallback"` + CookieGarbling bool `json:"-" tf:"cookie_garbling"` + CookieMode string `json:"-" tf:"cookie_mode"` + CookieType string `json:"-" tf:"cookie_type"` + CookieDomain string `json:"-" tf:"cookie_domain"` + CookiePath string `json:"-" tf:"cookie_path"` + MaxIdleTime int `json:"-" tf:"max_idle_time"` + MaxCookieAge int `json:"-" tf:"max_cookie_age"` + ProfileType string `json:"-" tf:"profile_type"` + SharePersistence bool `json:"-" tf:"share_persistence"` + MaxCookieLife int `json:"-" tf:"max_cookie_life"` } type CreateHttpProfileConfig struct { - HTTPIdleTimeout int `json:"httpIdleTimeout" tf:"http_idle_timeout"` - HTTPsRedirect string `json:"httpsRedirect" tf:"redirection"` - ProfileType string `json:"profileType" tf:"profile_type"` - RequestHeaderSize int `json:"requestHeaderSize" tf:"request_header_size"` - ResponseHeaderSize int `json:"responseHeaderSize" tf:"response_header_size"` - NtlmAuthentication bool `json:"ntlmAuthentication" tf:"ntlm_authentication"` - RequestBodySize string `json:"requestBodySize" tf:"request_body_size"` - ResponseTimeout int `json:"responseTimeout" tf:"response_timeout"` - XForwardedFor string `json:"xForwardedFor" tf:"x_forwarded_for"` + HTTPIdleTimeout int `json:"-" tf:"http_idle_timeout"` + HTTPsRedirect string `json:"-" tf:"redirection"` + ProfileType string `json:"-" tf:"profile_type"` + RequestHeaderSize int `json:"-" tf:"request_header_size"` + ResponseHeaderSize int `json:"-" tf:"response_header_size"` + NtlmAuthentication bool `json:"-" tf:"ntlm_authentication"` + RequestBodySize string `json:"-" tf:"request_body_size"` + ResponseTimeout int `json:"-" tf:"response_timeout"` + XForwardedFor string `json:"-" tf:"x_forwarded_for"` } type CreateTcpProfileConfig struct { - ConnectionCloseTimeout int `json:"connectionCloseTimeout" tf:"connection_close_timeout"` - FastTCPIdleTimeout int `json:"fastTcpIdleTimeout" tf:"fast_tcp_idle_timeout"` - HaFlowMirroring bool `json:"haFlowMirroring" tf:"ha_flow_mirroring"` - ProfileType string `json:"profileType" tf:"profile_type"` + ConnectionCloseTimeout int `json:"-" tf:"connection_close_timeout"` + FastTCPIdleTimeout int `json:"-" tf:"fast_tcp_idle_timeout"` + HaFlowMirroring bool `json:"-" tf:"ha_flow_mirroring"` + ProfileType string `json:"-" tf:"profile_type"` } type CreateUdpProfileConfig struct { - FastUDPIdleTimeout int `json:"fastUdpIdleTimeout" tf:"fast_udp_idle_timeout"` - ProfileType string `json:"profileType" tf:"profile_type"` - HaFlowMirroring bool `json:"haFlowMirroring" tf:"ha_flow_mirroring"` + FastUDPIdleTimeout int `json:"-" tf:"fast_udp_idle_timeout"` + ProfileType string `json:"-" tf:"profile_type"` + HaFlowMirroring bool `json:"-" tf:"ha_flow_mirroring"` } type Tags struct { @@ -553,18 +553,18 @@ type GetSpecificLBMonitorResp struct { Name string `json:"name"` Visibility string `json:"visibility"` Description string `json:"description"` - Timeout int `json:"monitorTimeout" tf:"timeout"` - Interval int `json:"monitorInterval" tf:"interval"` - RequestVersion string `json:"sendVersion" tf:"request_version"` - RequestMethod string `json:"sendType" tf:"request_method"` - ResponseStatusCodes string `json:"receiveCode" tf:"response_status_codes"` - ResponseData string `json:"receiveData" tf:"response_data"` - RequestURL string `json:"monitorDestination" tf:"request_url"` - RequestBody string `json:"sendData" tf:"request_body"` - AliasPort int `json:"aliasPort" tf:"monitor_port"` - RiseCount int `json:"riseCount" tf:"rise_count"` - FallCount int `json:"fallCount" tf:"fall_count"` - DataLength int `json:"dataLength" tf:"data_length"` + Timeout int `json:"monitorTimeout"` + Interval int `json:"monitorInterval"` + RequestVersion string `json:"sendVersion"` + RequestMethod string `json:"sendType"` + ResponseStatusCodes string `json:"receiveCode"` + ResponseData string `json:"receiveData"` + RequestURL string `json:"monitorDestination"` + RequestBody string `json:"sendData"` + AliasPort int `json:"aliasPort"` + RiseCount int `json:"riseCount"` + FallCount int `json:"fallCount"` + DataLength int `json:"dataLength"` InternalID string `json:"internalId"` MonitorSource string `json:"monitorSource"` Status string `json:"status"`