Skip to content

Commit

Permalink
feat(glb monitor): added header field in output
Browse files Browse the repository at this point in the history
  • Loading branch information
KumarGanesanIBM committed Sep 7, 2020
1 parent cda1816 commit a253b8d
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 20 deletions.
6 changes: 3 additions & 3 deletions cachingapiv1/caching_api_v1_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"os"

"github.com/IBM/go-sdk-core/core"
. "github.com/IBM/networking-go-sdk/cachingapiv1"
"github.com/joho/godotenv"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/IBM/networking-go-sdk/cachingapiv1"
)

const configFile = "../cis.env"
Expand Down Expand Up @@ -54,8 +54,8 @@ var _ = Describe(`cachingapiv1_test`, func() {
if serviceErr != nil {
fmt.Println(serviceErr)
}
Describe(`zoneratelimitsv1_test`, func() {
Context(`zoneratelimitsv1_test`, func() {
Describe(`cachingapiv1_test`, func() {
Context(`cachingapiv1_test`, func() {
It(`cache purge by urls`, func() {
shouldSkipTest()
cacheOpt := service.NewPurgeByUrlsOptions()
Expand Down
4 changes: 2 additions & 2 deletions custompagesv1/custom_pages_v1_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"os"

"github.com/IBM/go-sdk-core/core"
. "github.com/IBM/networking-go-sdk/custompagesv1"
"github.com/joho/godotenv"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/IBM/networking-go-sdk/custompagesv1"
)

const configFile = "../cis.env"
Expand All @@ -25,7 +25,7 @@ func shouldSkipTest() {
}
}

var _ = Describe(`zoneratelimitsv1`, func() {
var _ = Describe(`custompagesv1_test`, func() {
if _, err := os.Stat(configFile); err != nil {
configLoaded = false
}
Expand Down
6 changes: 3 additions & 3 deletions firewallapiv1/firewall_api_v1_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"os"

"github.com/IBM/go-sdk-core/core"
. "github.com/IBM/networking-go-sdk/firewallapiv1"
"github.com/joho/godotenv"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/IBM/networking-go-sdk/firewallapiv1"
)

const configFile = "../cis.env"
Expand Down Expand Up @@ -54,8 +54,8 @@ var _ = Describe(`firewallapiv1_test`, func() {
if serviceErr != nil {
fmt.Println(serviceErr)
}
Describe(`zoneratelimitsv1_test`, func() {
Context(`zoneratelimitsv1_test`, func() {
Describe(`firewallapiv1_test`, func() {
Context(`firewallapiv1_test`, func() {
It(`security level setting test`, func() {
shouldSkipTest()
values := []string{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,9 @@ type MonitorPack struct {

// allow insecure.
AllowInsecure *bool `json:"allow_insecure,omitempty"`

// header.
Header map[string][]string `json:"header,omitempty"`
}


Expand Down Expand Up @@ -1018,6 +1021,10 @@ func UnmarshalMonitorPack(m map[string]json.RawMessage, result interface{}) (err
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "header", &obj.Header)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var _ = Describe(`GlobalLoadBalancerMonitorV1`, func() {
if testServiceErr != nil {
fmt.Println(testServiceErr)
}
Describe(`CIS_Frontend_API_Spec-GLB_Monitor.yaml`, func() {
Describe(`GlobalLoadBalancerMonitorV1`, func() {
Context(`Global Load Balancer Monitor`, func() {
BeforeEach(func() {
shouldSkipTest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ var _ = Describe(`GlobalLoadBalancerMonitorV1`, func() {
Expect(req.Method).To(Equal("GET"))
res.Header().Set("Content-type", "application/json")
res.WriteHeader(200)
fmt.Fprintf(res, `{"success": true, "errors": [["Errors"]], "messages": [["Messages"]], "result": [{"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "type": "http", "description": "Login page monitor", "method": "GET", "port": 8080, "path": "/", "timeout": 5, "retries": 2, "interval": 60, "expected_body": "alive", "expected_codes": "2xx", "follow_redirects": true, "allow_insecure": true}], "result_info": {"page": 1, "per_page": 20, "count": 1, "total_count": 2000}}`)
fmt.Fprintf(res, `{"success": true, "errors": [["Errors"]], "messages": [["Messages"]], "result": [{"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "type": "http", "description": "Login page monitor", "method": "GET", "port": 8080, "path": "/", "timeout": 5, "retries": 2, "interval": 60, "expected_body": "alive", "expected_codes": "2xx", "follow_redirects": true, "allow_insecure": true, "header": {"mapKey": ["Inner"]}}], "result_info": {"page": 1, "per_page": 20, "count": 1, "total_count": 2000}}`)
}))
})
It(`Invoke ListAllLoadBalancerMonitors successfully`, func() {
Expand Down Expand Up @@ -322,7 +322,7 @@ var _ = Describe(`GlobalLoadBalancerMonitorV1`, func() {
Expect(req.Method).To(Equal("POST"))
res.Header().Set("Content-type", "application/json")
res.WriteHeader(200)
fmt.Fprintf(res, `{"success": true, "errors": [["Errors"]], "messages": [["Messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "type": "http", "description": "Login page monitor", "method": "GET", "port": 8080, "path": "/", "timeout": 5, "retries": 2, "interval": 60, "expected_body": "alive", "expected_codes": "2xx", "follow_redirects": true, "allow_insecure": true}}`)
fmt.Fprintf(res, `{"success": true, "errors": [["Errors"]], "messages": [["Messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "type": "http", "description": "Login page monitor", "method": "GET", "port": 8080, "path": "/", "timeout": 5, "retries": 2, "interval": 60, "expected_body": "alive", "expected_codes": "2xx", "follow_redirects": true, "allow_insecure": true, "header": {"mapKey": ["Inner"]}}}`)
}))
})
It(`Invoke CreateLoadBalancerMonitor successfully`, func() {
Expand Down Expand Up @@ -469,7 +469,7 @@ var _ = Describe(`GlobalLoadBalancerMonitorV1`, func() {
Expect(req.Method).To(Equal("PUT"))
res.Header().Set("Content-type", "application/json")
res.WriteHeader(200)
fmt.Fprintf(res, `{"success": true, "errors": [["Errors"]], "messages": [["Messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "type": "http", "description": "Login page monitor", "method": "GET", "port": 8080, "path": "/", "timeout": 5, "retries": 2, "interval": 60, "expected_body": "alive", "expected_codes": "2xx", "follow_redirects": true, "allow_insecure": true}}`)
fmt.Fprintf(res, `{"success": true, "errors": [["Errors"]], "messages": [["Messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "type": "http", "description": "Login page monitor", "method": "GET", "port": 8080, "path": "/", "timeout": 5, "retries": 2, "interval": 60, "expected_body": "alive", "expected_codes": "2xx", "follow_redirects": true, "allow_insecure": true, "header": {"mapKey": ["Inner"]}}}`)
}))
})
It(`Invoke EditLoadBalancerMonitor successfully`, func() {
Expand Down Expand Up @@ -729,7 +729,7 @@ var _ = Describe(`GlobalLoadBalancerMonitorV1`, func() {
Expect(req.Method).To(Equal("GET"))
res.Header().Set("Content-type", "application/json")
res.WriteHeader(200)
fmt.Fprintf(res, `{"success": true, "errors": [["Errors"]], "messages": [["Messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "type": "http", "description": "Login page monitor", "method": "GET", "port": 8080, "path": "/", "timeout": 5, "retries": 2, "interval": 60, "expected_body": "alive", "expected_codes": "2xx", "follow_redirects": true, "allow_insecure": true}}`)
fmt.Fprintf(res, `{"success": true, "errors": [["Errors"]], "messages": [["Messages"]], "result": {"id": "f1aba936b94213e5b8dca0c0dbf1f9cc", "created_on": "2014-01-01T05:20:00.12345Z", "modified_on": "2014-01-01T05:20:00.12345Z", "type": "http", "description": "Login page monitor", "method": "GET", "port": 8080, "path": "/", "timeout": 5, "retries": 2, "interval": 60, "expected_body": "alive", "expected_codes": "2xx", "follow_redirects": true, "allow_insecure": true, "header": {"mapKey": ["Inner"]}}}`)
}))
})
It(`Invoke GetLoadBalancerMonitor successfully`, func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"strings"

"github.com/IBM/go-sdk-core/core"
"github.com/joho/godotenv"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/IBM/networking-go-sdk/globalloadbalancermonitorv1"
"github.com/IBM/networking-go-sdk/globalloadbalancerpoolsv0"
. "github.com/IBM/networking-go-sdk/globalloadbalancerv1"
"github.com/joho/godotenv"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

const configFile = "../cis.env"
Expand Down
8 changes: 4 additions & 4 deletions zonessettingsv1/zones_settings_v1_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"strings"

"github.com/IBM/go-sdk-core/v4/core"
. "github.com/IBM/networking-go-sdk/zonessettingsv1"
"github.com/joho/godotenv"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/IBM/networking-go-sdk/zonessettingsv1"
)

const configFile = "../cis.env"
Expand All @@ -26,7 +26,7 @@ func shouldSkipTest() {
}
}

var _ = Describe(`zoneratelimitsv1`, func() {
var _ = Describe(`zone_settings_v1_test`, func() {
if _, err := os.Stat(configFile); err != nil {
configLoaded = false
}
Expand Down Expand Up @@ -56,8 +56,8 @@ var _ = Describe(`zoneratelimitsv1`, func() {
if serviceErr != nil {
fmt.Println(serviceErr)
}
Describe(`zoneratelimitsv1_test`, func() {
Context(`zoneratelimitsv1_test`, func() {
Describe(`zone_settings_v1_test`, func() {
Context(`zone_settings_v1_test`, func() {
It(`DNSSEC setting test`, func() {
shouldSkipTest()
getOpt := service.NewGetZoneDnssecOptions()
Expand Down

0 comments on commit a253b8d

Please sign in to comment.