diff --git a/api/cis/cisv1/dns.go b/api/cis/cisv1/dns.go index ae22cdab..baac0219 100644 --- a/api/cis/cisv1/dns.go +++ b/api/cis/cisv1/dns.go @@ -112,7 +112,7 @@ func (r *dns) CreateDns(cisId string, zoneId string, dnsBody DnsBody) (*DnsRecor func (r *dns) UpdateDns(cisId string, zoneId string, dnsId string, dnsBody DnsBody) (*DnsRecord, error) { dnsResult := DnsResult{} rawURL := fmt.Sprintf("/v1/%s/zones/%s/dns_records/%s", cisId, zoneId, dnsId) - _, err := r.client.Post(rawURL, &dnsBody, &dnsResult) + _, err := r.client.Put(rawURL, &dnsBody, &dnsResult) if err != nil { return nil, err } diff --git a/api/cis/cisv1/dns_test.go b/api/cis/cisv1/dns_test.go index fbd44b39..efd26c26 100644 --- a/api/cis/cisv1/dns_test.go +++ b/api/cis/cisv1/dns_test.go @@ -8,11 +8,9 @@ import ( "github.com/IBM-Cloud/bluemix-go/client" bluemixHttp "github.com/IBM-Cloud/bluemix-go/http" "github.com/IBM-Cloud/bluemix-go/session" - - "github.com/onsi/gomega/ghttp" - . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/onsi/gomega/ghttp" ) var _ = Describe("Dns", func() { @@ -320,7 +318,7 @@ var _ = Describe("Dns", func() { `), ), ghttp.CombineHandlers( - ghttp.VerifyRequest(http.MethodPost, "/v1/crn:v1:staging:public:iam::::apikey:ApiKey-62fefdd1-4557-4c7d-8a1c-f6da7ee2ff3a/zones/3fefc35e7decadb111dcf85d723a4f20/dns_records/0f4740fc36065f8a9343c7ed9445f2a4"), + ghttp.VerifyRequest(http.MethodPut, "/v1/crn:v1:staging:public:iam::::apikey:ApiKey-62fefdd1-4557-4c7d-8a1c-f6da7ee2ff3a/zones/3fefc35e7decadb111dcf85d723a4f20/dns_records/0f4740fc36065f8a9343c7ed9445f2a4"), ghttp.RespondWith(http.StatusCreated, ` { "result": { @@ -376,7 +374,7 @@ var _ = Describe("Dns", func() { server = ghttp.NewServer() server.AppendHandlers( ghttp.CombineHandlers( - ghttp.VerifyRequest(http.MethodPost, "/v1/crn:v1:staging:public:iam::::apikey:ApiKey-62fefdd1-4557-4c7d-8a1c-f6da7ee2ff3a/zones/0f4740fc36065f8a9343c7ed9445f2a4/dns_records/0f4740fc36065f8a9343c7ed9445f2a4"), + ghttp.VerifyRequest(http.MethodPut, "/v1/crn:v1:staging:public:iam::::apikey:ApiKey-62fefdd1-4557-4c7d-8a1c-f6da7ee2ff3a/zones/0f4740fc36065f8a9343c7ed9445f2a4/dns_records/0f4740fc36065f8a9343c7ed9445f2a4"), ghttp.RespondWith(http.StatusInternalServerError, `Failed to update Dns`), ), ) diff --git a/api/cis/cisv1/glbs.go b/api/cis/cisv1/glbs.go index 6a004d16..d3671fad 100644 --- a/api/cis/cisv1/glbs.go +++ b/api/cis/cisv1/glbs.go @@ -115,7 +115,7 @@ func (r *glbs) CreateGlb(cisId string, zoneId string, glbBody GlbBody) (*Glb, er func (r *glbs) UpdateGlb(cisId string, zoneId string, glbId string, glbBody GlbBody) (*Glb, error) { glbResult := GlbResult{} rawURL := fmt.Sprintf("/v1/%s/zones/%s/load_balancers/%s", cisId, zoneId, glbId) - _, err := r.client.Post(rawURL, &glbBody, &glbResult) + _, err := r.client.Put(rawURL, &glbBody, &glbResult) if err != nil { return nil, err } diff --git a/api/cis/cisv1/glbs_test.go b/api/cis/cisv1/glbs_test.go index 3312c9f0..c4b66a4a 100644 --- a/api/cis/cisv1/glbs_test.go +++ b/api/cis/cisv1/glbs_test.go @@ -8,11 +8,9 @@ import ( "github.com/IBM-Cloud/bluemix-go/client" bluemixHttp "github.com/IBM-Cloud/bluemix-go/http" "github.com/IBM-Cloud/bluemix-go/session" - - "github.com/onsi/gomega/ghttp" - . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/onsi/gomega/ghttp" ) var _ = Describe("Glbs", func() { @@ -353,7 +351,7 @@ var _ = Describe("Glbs", func() { `), ), ghttp.CombineHandlers( - ghttp.VerifyRequest(http.MethodPost, "/v1/crn:v1:staging:public:iam::::apikey:ApiKey-62fefdd1-4557-4c7d-8a1c-f6da7ee2ff3a/zones/3fefc35e7decadb111dcf85d723a4f20/load_balancers/07085e0ea3c40225dcab6aff04cf64d9"), + ghttp.VerifyRequest(http.MethodPut, "/v1/crn:v1:staging:public:iam::::apikey:ApiKey-62fefdd1-4557-4c7d-8a1c-f6da7ee2ff3a/zones/3fefc35e7decadb111dcf85d723a4f20/load_balancers/07085e0ea3c40225dcab6aff04cf64d9"), ghttp.VerifyJSON(`{"proxied": true, "name": "www.example.com", "session_affinity": "none", "fallback_pool": "4112ba6c2974ec43886f90736968e888", "default_pools": ["6563ebae141638f92ebbdc4a821bef8c", "4112ba6c2974ec43886f90736968e838"]}`), ghttp.RespondWith(http.StatusCreated, ` { @@ -428,7 +426,7 @@ var _ = Describe("Glbs", func() { server = ghttp.NewServer() server.AppendHandlers( ghttp.CombineHandlers( - ghttp.VerifyRequest(http.MethodPost, "/v1/crn:v1:staging:public:iam::::apikey:ApiKey-62fefdd1-4557-4c7d-8a1c-f6da7ee2ff3a/zones/3fefc35e7decadb111dcf85d723a4f20/load_balancers/07085e0ea3c40225dcab6aff04cf64d9"), + ghttp.VerifyRequest(http.MethodPut, "/v1/crn:v1:staging:public:iam::::apikey:ApiKey-62fefdd1-4557-4c7d-8a1c-f6da7ee2ff3a/zones/3fefc35e7decadb111dcf85d723a4f20/load_balancers/07085e0ea3c40225dcab6aff04cf64d9"), ghttp.RespondWith(http.StatusInternalServerError, `Failed to create Glb`), ), ) diff --git a/api/cis/cisv1/monitors.go b/api/cis/cisv1/monitors.go index 5c2f3921..ea26c7b7 100644 --- a/api/cis/cisv1/monitors.go +++ b/api/cis/cisv1/monitors.go @@ -37,9 +37,10 @@ type MonitorResult struct { } type MonitorBody struct { - ExpCodes string `json:"expected_codes"` - ExpBody string `json:"expected_body"` - Path string `json:"path"` + Description string `json:"description"` + ExpCodes string `json:"expected_codes"` + ExpBody string `json:"expected_body"` + Path string `json:"path"` // Headers ommited TBC MonType string `json:"type,omitempty"` Method string `json:"method,omitempty"` diff --git a/api/cis/cisv1/pools.go b/api/cis/cisv1/pools.go index 6b9cb98f..59f07509 100644 --- a/api/cis/cisv1/pools.go +++ b/api/cis/cisv1/pools.go @@ -126,7 +126,7 @@ func (r *pools) CreatePool(cisId string, poolBody PoolBody) (*Pool, error) { func (r *pools) UpdatePool(cisId string, poolId string, poolBody PoolBody) (*Pool, error) { poolResult := PoolResult{} rawURL := fmt.Sprintf("/v1/%s/load_balancers/pools/%s", cisId, poolId) - _, err := r.client.Post(rawURL, &poolBody, &poolResult) + _, err := r.client.Put(rawURL, &poolBody, &poolResult) if err != nil { return nil, err } diff --git a/api/cis/cisv1/pools_test.go b/api/cis/cisv1/pools_test.go index 24de906f..18cb40fe 100644 --- a/api/cis/cisv1/pools_test.go +++ b/api/cis/cisv1/pools_test.go @@ -8,11 +8,9 @@ import ( "github.com/IBM-Cloud/bluemix-go/client" bluemixHttp "github.com/IBM-Cloud/bluemix-go/http" "github.com/IBM-Cloud/bluemix-go/session" - - "github.com/onsi/gomega/ghttp" - . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/onsi/gomega/ghttp" ) var _ = Describe("Pools", func() { @@ -416,7 +414,7 @@ var _ = Describe("Pools", func() { `), ), ghttp.CombineHandlers( - ghttp.VerifyRequest(http.MethodPost, "/v1/crn:v1:staging:public:iam::::apikey:ApiKey-62fefdd1-4557-4c7d-8a1c-f6da7ee2ff3a/load_balancers/pools/4112ba6c2974ec43886f90736968e838"), + ghttp.VerifyRequest(http.MethodPut, "/v1/crn:v1:staging:public:iam::::apikey:ApiKey-62fefdd1-4557-4c7d-8a1c-f6da7ee2ff3a/load_balancers/pools/4112ba6c2974ec43886f90736968e838"), ghttp.RespondWith(http.StatusCreated, ` { "result": { @@ -506,7 +504,7 @@ var _ = Describe("Pools", func() { server = ghttp.NewServer() server.AppendHandlers( ghttp.CombineHandlers( - ghttp.VerifyRequest(http.MethodPost, "/v1/crn:v1:staging:public:iam::::apikey:ApiKey-62fefdd1-4557-4c7d-8a1c-f6da7ee2ff3a/load_balancers/pools/4112ba6c2974ec43886f90736968e838"), + ghttp.VerifyRequest(http.MethodPut, "/v1/crn:v1:staging:public:iam::::apikey:ApiKey-62fefdd1-4557-4c7d-8a1c-f6da7ee2ff3a/load_balancers/pools/4112ba6c2974ec43886f90736968e838"), ghttp.RespondWith(http.StatusInternalServerError, `Failed to create Pool`), ), )