diff --git a/bonsai/bonsai_test.go b/bonsai/bonsai_test.go index 04be1e5..c2ca0ba 100644 --- a/bonsai/bonsai_test.go +++ b/bonsai/bonsai_test.go @@ -8,6 +8,10 @@ import ( "path/filepath" ) +func Pointer[T any](d T) *T { + return &d +} + func init() { initLogger() } diff --git a/bonsai/cluster_test.go b/bonsai/cluster_test.go index 87480c6..04856a2 100644 --- a/bonsai/cluster_test.go +++ b/bonsai/cluster_test.go @@ -493,7 +493,7 @@ func (s *ClientVCRTestSuite) TestClusterClient_Create() { func (s *ClientVCRTestSuite) TestClusterClient_Update() { ctx := context.Background() - plan, err := s.client.Cluster.Update(ctx, "bonsai-api-go-2471463249", bonsai.ClusterUpdateOpts{ + plan, err := s.client.Cluster.Update(ctx, "bonsai-api-go-5431547241", bonsai.ClusterUpdateOpts{ Name: "bonsai-api-go-test-cluster-updated", Plan: "standard-nano-comped", }) @@ -504,7 +504,7 @@ func (s *ClientVCRTestSuite) TestClusterClient_Update() { func (s *ClientVCRTestSuite) TestClusterClient_Delete() { ctx := context.Background() - plan, err := s.client.Cluster.Destroy(ctx, "bonsai-api-go-9994392953") + plan, err := s.client.Cluster.Destroy(ctx, "bonsai-api-go-5431547241") s.NoError(err, "successfully get cluster") assertGolden(s, plan) } diff --git a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-All b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-All index 4c4894a..e4fb126 100644 --- a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-All +++ b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-All @@ -1,4 +1,34 @@ [ + { + "slug": "bonsai-api-go-3216591042", + "name": "bonsai-api-go-test-cluster-updated", + "uri": "https://api.bonsai.io/clusters/bonsai-api-go-3216591042", + "plan": { + "slug": "standard-nano-comped", + "available_releases": [], + "available_spaces": [], + "uri": "https://api.bonsai.io/plans/standard-nano-comped" + }, + "release": { + "slug": "opensearch-2.6.0-mt", + "service_type": "opensearch", + "version": "2.6.0", + "uri": "https://api.bonsai.io/releases/opensearch-2.6.0-mt", + "package_name": "2.6.0-mt" + }, + "space": { + "path": "omc/bonsai/us-east-1/common", + "region": "aws-us-east-1", + "uri": "https://api.bonsai.io/spaces/omc/bonsai/us-east-1/common" + }, + "stats": {}, + "access": { + "host": "bonsai-api-go-3216591042.us-east-1.bonsaisearch.net", + "port": 443, + "scheme": "https" + }, + "state": "PROVISIONED" + }, { "slug": "dcek-group-llc-5240651189", "name": "DCEK Group, LLC search", @@ -18,11 +48,6 @@ }, "space": { "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - }, "region": "aws-us-east-1", "uri": "https://api.bonsai.io/spaces/omc/bonsai/us-east-1/common" }, diff --git a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-Create b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-Create index f221178..bac8cb6 100644 --- a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-Create +++ b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-Create @@ -1,12 +1,12 @@ { "message": "Your cluster is being provisioned.", - "monitor": "https://api.bonsai.io/clusters/bonsai-api-go-2471463249", + "monitor": "https://api.bonsai.io/clusters/bonsai-api-go-5431547241", "access": { - "host": "bonsai-api-go-2471463249", + "host": "bonsai-api-go-5431547241", "port": 443, "scheme": "https", "user": "REDACTED", "pass": "REDACTED", - "url": "://REDACTED:REDACTED" + "url": "://REDACTED:REDACTED@" } } \ No newline at end of file diff --git a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-Delete b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-Delete index fa75d39..2495852 100644 --- a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-Delete +++ b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-Delete @@ -1,4 +1,4 @@ { "message": "Your cluster is being deprovisioned.", - "monitor": "https://api.bonsai.io/clusters/bonsai-api-go-9994392953" + "monitor": "https://api.bonsai.io/clusters/bonsai-api-go-5431547241" } \ No newline at end of file diff --git a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-GetBySlug b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-GetBySlug index 20de9c4..3bcc1aa 100644 --- a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-GetBySlug +++ b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-GetBySlug @@ -17,11 +17,6 @@ }, "space": { "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - }, "region": "aws-us-east-1", "uri": "https://api.bonsai.io/spaces/omc/bonsai/us-east-1/common" }, diff --git a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-Update b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-Update index b2195fa..336e91e 100644 --- a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-Update +++ b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestClusterClient-Update @@ -1,4 +1,4 @@ { "message": "Your cluster is being updated.", - "monitor": "https://api.bonsai.io/clusters/bonsai-api-go-2471463249" + "monitor": "https://api.bonsai.io/clusters/bonsai-api-go-5431547241" } \ No newline at end of file diff --git a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestPlanClient-All b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestPlanClient-All index 10ac2de..4eeb39e 100644 --- a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestPlanClient-All +++ b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestPlanClient-All @@ -3,6 +3,8 @@ "slug": "standard-nano-comped", "name": "Standard Nano", "billing_interval_months": 1, + "single_tenant": false, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-5.6.16" @@ -19,76 +21,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -96,6 +53,8 @@ "slug": "sandbox-aws-us-east-1", "name": "Sandbox", "billing_interval_months": 1, + "single_tenant": false, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-7.10.2" @@ -106,76 +65,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -184,6 +98,8 @@ "name": "Standard Micro", "price_in_cents": 2000, "billing_interval_months": 1, + "single_tenant": false, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-5.6.16" @@ -200,76 +116,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -279,6 +150,7 @@ "price_in_cents": 200000, "billing_interval_months": 1, "single_tenant": true, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-2.4.0" @@ -319,76 +191,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -398,6 +225,7 @@ "price_in_cents": 95000, "billing_interval_months": 1, "single_tenant": true, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-2.4.0" @@ -438,76 +266,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -517,6 +300,7 @@ "price_in_cents": 70000, "billing_interval_months": 1, "single_tenant": true, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-2.4.0" @@ -557,76 +341,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -635,6 +374,8 @@ "name": "Standard MD", "price_in_cents": 25000, "billing_interval_months": 1, + "single_tenant": false, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-5.6.16" @@ -651,76 +392,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -771,76 +467,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -850,6 +501,7 @@ "price_in_cents": 140000, "billing_interval_months": 1, "single_tenant": true, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-2.4.0" @@ -890,76 +542,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -1010,76 +617,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -1130,76 +692,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -1208,6 +725,8 @@ "name": "Standard Nano", "price_in_cents": 5000, "billing_interval_months": 1, + "single_tenant": false, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-5.6.16" @@ -1224,76 +743,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -1344,76 +818,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -1423,6 +852,7 @@ "price_in_cents": 125000, "billing_interval_months": 1, "single_tenant": true, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-2.4.0" @@ -1463,76 +893,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -1583,76 +968,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -1661,6 +1001,8 @@ "name": "Standard SM", "price_in_cents": 15000, "billing_interval_months": 1, + "single_tenant": false, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-5.6.16" @@ -1677,76 +1019,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -1756,6 +1053,7 @@ "price_in_cents": 85000, "billing_interval_months": 1, "single_tenant": true, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-2.4.0" @@ -1796,76 +1094,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] }, @@ -1916,76 +1169,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] } diff --git a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestPlanClient-GetByPath b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestPlanClient-GetByPath index 4db0b7c..c9c13f7 100644 --- a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestPlanClient-GetByPath +++ b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestPlanClient-GetByPath @@ -3,6 +3,8 @@ "name": "Standard Micro", "price_in_cents": 2000, "billing_interval_months": 1, + "single_tenant": false, + "private_network": false, "available_releases": [ { "slug": "elasticsearch-5.6.16" @@ -19,76 +21,31 @@ ], "available_spaces": [ { - "path": "omc/bonsai-gcp/us-east4/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-east4/common" }, { - "path": "omc/bonsai-gcp/us-west1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai-gcp/us-west1/common" }, { - "path": "omc/bonsai/ap-northeast-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-northeast-1/common" }, { - "path": "omc/bonsai/ap-southeast-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/ap-southeast-2/common" }, { - "path": "omc/bonsai/eu-central-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-central-1/common" }, { - "path": "omc/bonsai/eu-west-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/eu-west-1/common" }, { - "path": "omc/bonsai/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-east-1/common" }, { - "path": "omc/bonsai/us-west-2/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/bonsai/us-west-2/common" }, { - "path": "omc/websolr/us-east-1/common", - "private_network": false, - "cloud": { - "provider": "", - "region": "" - } + "path": "omc/websolr/us-east-1/common" } ] } \ No newline at end of file diff --git a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestReleaseClient-All b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestReleaseClient-All index 7bf565a..d3a5268 100644 --- a/bonsai/fixtures/golden/TestClientVCRTestSuite-TestReleaseClient-All +++ b/bonsai/fixtures/golden/TestClientVCRTestSuite-TestReleaseClient-All @@ -4,6 +4,7 @@ "slug": "elasticsearch-2.4.0", "service_type": "elasticsearch", "version": "2.4.0", + "multitenant": false, "package_name": "2.4.0" }, { @@ -19,6 +20,7 @@ "slug": "elasticsearch-6.3.2", "service_type": "elasticsearch", "version": "6.3.2", + "multitenant": false, "package_name": "6.3.2" }, { @@ -26,6 +28,7 @@ "slug": "elasticsearch-6.4.2", "service_type": "elasticsearch", "version": "6.4.2", + "multitenant": false, "package_name": "6.4.2" }, { @@ -33,6 +36,7 @@ "slug": "elasticsearch-6.5.4", "service_type": "elasticsearch", "version": "6.5.4", + "multitenant": false, "package_name": "6.5.4" }, { @@ -40,6 +44,7 @@ "slug": "elasticsearch-6.8.17", "service_type": "elasticsearch", "version": "6.8.17", + "multitenant": false, "package_name": "6.8.17" }, { @@ -47,6 +52,7 @@ "slug": "elasticsearch-6.8.19", "service_type": "elasticsearch", "version": "6.8.19", + "multitenant": false, "package_name": "6.8.19" }, { @@ -70,6 +76,7 @@ "slug": "opensearch-1.2.4", "service_type": "opensearch", "version": "1.2.4", + "multitenant": false, "package_name": "1.2.4" }, { @@ -77,6 +84,7 @@ "slug": "opensearch-2.3.0", "service_type": "opensearch", "version": "2.3.0", + "multitenant": false, "package_name": "2.3.0" }, { diff --git a/bonsai/fixtures/vcr/TestClusterClient-All.yaml b/bonsai/fixtures/vcr/TestClusterClient-All.yaml index e42b384..4de6f98 100644 --- a/bonsai/fixtures/vcr/TestClusterClient-All.yaml +++ b/bonsai/fixtures/vcr/TestClusterClient-All.yaml @@ -20,7 +20,7 @@ interactions: Content-Type: - application/json User-Agent: - - bonsai-api-go/v1 bonsai-api-go/1.0.0 + - bonsai-api-go/v2.2.0 bonsai-api-go/v2.2.0 url: https://api.bonsai.io/clusters method: GET response: @@ -32,7 +32,7 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"pagination":{"page_number":1,"page_size":1000,"total_records":1},"clusters":[{"slug":"dcek-group-llc-5240651189","name":"DCEK Group, LLC search","uri":"https://api.bonsai.io/clusters/dcek-group-llc-5240651189","plan":{"slug":"sandbox-aws-us-east-1","uri":"https://api.bonsai.io/plans/sandbox-aws-us-east-1"},"release":{"service_type":"elasticsearch","package_name":"7.10.2","version":"7.10.2","slug":"elasticsearch-7.10.2","uri":"https://api.bonsai.io/releases/elasticsearch-7.10.2"},"space":{"path":"omc/bonsai/us-east-1/common","region":"aws-us-east-1","uri":"https://api.bonsai.io/spaces/omc/bonsai/us-east-1/common"},"stats":{"docs":2,"shards_used":2,"data_bytes_used":17984},"access":{"host":"dcek-group-llc-5240651189.us-east-1.bonsaisearch.net","port":443,"scheme":"https"},"state":"PROVISIONED"}]}' + body: '{"pagination":{"page_number":1,"page_size":1000,"total_records":2},"clusters":[{"slug":"bonsai-api-go-3216591042","name":"bonsai-api-go-test-cluster-updated","uri":"https://api.bonsai.io/clusters/bonsai-api-go-3216591042","plan":{"slug":"standard-nano-comped","uri":"https://api.bonsai.io/plans/standard-nano-comped"},"release":{"service_type":"opensearch","package_name":"2.6.0-mt","version":"2.6.0","slug":"opensearch-2.6.0-mt","uri":"https://api.bonsai.io/releases/opensearch-2.6.0-mt"},"space":{"path":"omc/bonsai/us-east-1/common","region":"aws-us-east-1","uri":"https://api.bonsai.io/spaces/omc/bonsai/us-east-1/common"},"stats":{"docs":0,"shards_used":0,"data_bytes_used":0},"access":{"host":"bonsai-api-go-3216591042.us-east-1.bonsaisearch.net","port":443,"scheme":"https"},"state":"PROVISIONED"},{"slug":"dcek-group-llc-5240651189","name":"DCEK Group, LLC search","uri":"https://api.bonsai.io/clusters/dcek-group-llc-5240651189","plan":{"slug":"sandbox-aws-us-east-1","uri":"https://api.bonsai.io/plans/sandbox-aws-us-east-1"},"release":{"service_type":"elasticsearch","package_name":"7.10.2","version":"7.10.2","slug":"elasticsearch-7.10.2","uri":"https://api.bonsai.io/releases/elasticsearch-7.10.2"},"space":{"path":"omc/bonsai/us-east-1/common","region":"aws-us-east-1","uri":"https://api.bonsai.io/spaces/omc/bonsai/us-east-1/common"},"stats":{"docs":2,"shards_used":2,"data_bytes_used":17984},"access":{"host":"dcek-group-llc-5240651189.us-east-1.bonsaisearch.net","port":443,"scheme":"https"},"state":"PROVISIONED"}]}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -43,9 +43,9 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Sat, 04 May 2024 11:42:50 GMT + - Wed, 15 May 2024 01:07:06 GMT Etag: - - W/"067d073e09ae505a2c52df89d915b0af" + - W/"cd402e924a5732f3365a768550ff38a1" Referrer-Policy: - strict-origin-when-cross-origin Server: @@ -65,11 +65,11 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 625ee3ed-ab85-4fde-8d5d-97d7d564680d + - 10ffc134-f484-4586-b5a7-caad4fa2b016 X-Runtime: - - "0.046763" + - "0.067215" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 - duration: 292.8763ms + duration: 320.8215ms diff --git a/bonsai/fixtures/vcr/TestClusterClient-Create.yaml b/bonsai/fixtures/vcr/TestClusterClient-Create.yaml index e9d8881..8797230 100644 --- a/bonsai/fixtures/vcr/TestClusterClient-Create.yaml +++ b/bonsai/fixtures/vcr/TestClusterClient-Create.yaml @@ -20,7 +20,7 @@ interactions: Content-Type: - application/json User-Agent: - - bonsai-api-go/v1 bonsai-api-go/1.0.0 + - bonsai-api-go/v2.2.0 bonsai-api-go/v2.2.0 url: https://api.bonsai.io/clusters method: POST response: @@ -32,7 +32,7 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"message":"Your cluster is being provisioned.","monitor":"https://api.bonsai.io/clusters/bonsai-api-go-2471463249","access":{"user":"REDACTED","pass":"REDACTED","host":"bonsai-api-go-2471463249","port":443,"scheme":"https","url":"://REDACTED:REDACTED"},"status":202}' + body: '{"message":"Your cluster is being provisioned.","monitor":"https://api.bonsai.io/clusters/bonsai-api-go-5431547241","access":{"user":"REDACTED","pass":"REDACTED","host":"bonsai-api-go-5431547241","port":443,"scheme":"https","url":"://REDACTED:REDACTED@"},"status":202}' headers: Cache-Control: - no-cache @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Sat, 04 May 2024 11:42:50 GMT + - Wed, 15 May 2024 01:08:32 GMT Referrer-Policy: - strict-origin-when-cross-origin Server: @@ -63,11 +63,11 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 12370295-cde9-46cb-a6bc-f23903e5a4dd + - 741db3ce-ea88-4c99-b85b-77ee7b1eda7b X-Runtime: - - "0.098205" + - "0.162795" X-Xss-Protection: - 1; mode=block status: 202 Accepted code: 202 - duration: 130.6072ms + duration: 426.2471ms diff --git a/bonsai/fixtures/vcr/TestClusterClient-Delete.yaml b/bonsai/fixtures/vcr/TestClusterClient-Delete.yaml index aee25ba..3eb3797 100644 --- a/bonsai/fixtures/vcr/TestClusterClient-Delete.yaml +++ b/bonsai/fixtures/vcr/TestClusterClient-Delete.yaml @@ -20,8 +20,8 @@ interactions: Content-Type: - application/json User-Agent: - - bonsai-api-go/v1 bonsai-api-go/1.0.0 - url: https://api.bonsai.io/clusters/bonsai-api-go-9994392953 + - bonsai-api-go/v2.2.0 bonsai-api-go/v2.2.0 + url: https://api.bonsai.io/clusters/bonsai-api-go-5431547241 method: DELETE response: proto: HTTP/1.1 @@ -32,7 +32,7 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"message":"Your cluster is being deprovisioned.","monitor":"https://api.bonsai.io/clusters/bonsai-api-go-9994392953","status":202}' + body: '{"message":"Your cluster is being deprovisioned.","monitor":"https://api.bonsai.io/clusters/bonsai-api-go-5431547241","status":202}' headers: Cache-Control: - no-cache @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Sat, 04 May 2024 11:42:50 GMT + - Wed, 15 May 2024 01:09:20 GMT Referrer-Policy: - strict-origin-when-cross-origin Server: @@ -63,11 +63,11 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - bc1f6723-f11b-4653-b1c5-84588880905e + - 34fbe67d-96a4-4462-8c1a-efecc955e709 X-Runtime: - - "0.035741" + - "0.037872" X-Xss-Protection: - 1; mode=block status: 202 Accepted code: 202 - duration: 71.2158ms + duration: 357.3277ms diff --git a/bonsai/fixtures/vcr/TestClusterClient-GetBySlug.yaml b/bonsai/fixtures/vcr/TestClusterClient-GetBySlug.yaml index 2910911..6a83838 100644 --- a/bonsai/fixtures/vcr/TestClusterClient-GetBySlug.yaml +++ b/bonsai/fixtures/vcr/TestClusterClient-GetBySlug.yaml @@ -20,7 +20,7 @@ interactions: Content-Type: - application/json User-Agent: - - bonsai-api-go/v2.1.0 bonsai-api-go/v2.1.0 + - bonsai-api-go/v2.2.0 bonsai-api-go/v2.2.0 url: https://api.bonsai.io/clusters/dcek-group-llc-5240651189 method: GET response: @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Wed, 15 May 2024 00:14:38 GMT + - Wed, 15 May 2024 01:09:14 GMT Etag: - W/"c289f3e152b59209b26bcc8f03b2a044" Referrer-Policy: @@ -65,11 +65,11 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 989e03a8-77ec-4ac4-9dd5-927b8dd88683 + - f15d031e-da32-47e7-acdc-d9dc1544f9b2 X-Runtime: - - "0.059638" + - "0.038887" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 - duration: 337.2444ms + duration: 303.6778ms diff --git a/bonsai/fixtures/vcr/TestClusterClient-Update.yaml b/bonsai/fixtures/vcr/TestClusterClient-Update.yaml index d47d509..884bc9f 100644 --- a/bonsai/fixtures/vcr/TestClusterClient-Update.yaml +++ b/bonsai/fixtures/vcr/TestClusterClient-Update.yaml @@ -20,8 +20,8 @@ interactions: Content-Type: - application/json User-Agent: - - bonsai-api-go/v1 bonsai-api-go/1.0.0 - url: https://api.bonsai.io/clusters/bonsai-api-go-9994392953 + - bonsai-api-go/v2.2.0 bonsai-api-go/v2.2.0 + url: https://api.bonsai.io/clusters/bonsai-api-go-5431547241 method: PUT response: proto: HTTP/1.1 @@ -32,7 +32,7 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"errors":["This cluster is no longer active and cannot be modified. Solution: Please select a different cluster.","Your request could not be processed. "],"status":422}' + body: '{"message":"Your cluster is being updated.","monitor":"https://api.bonsai.io/clusters/bonsai-api-go-5431547241","status":202}' headers: Cache-Control: - no-cache @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Sat, 04 May 2024 11:42:50 GMT + - Wed, 15 May 2024 01:09:00 GMT Referrer-Policy: - strict-origin-when-cross-origin Server: @@ -63,81 +63,11 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 67072137-6c4a-4c65-966e-2a8ea65d9668 + - 115f6218-2693-4621-93d5-f3375bf1eb05 X-Runtime: - - "0.043148" - X-Xss-Protection: - - 1; mode=block - status: 422 Unprocessable Entity - code: 422 - duration: 73.4967ms - - id: 1 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 75 - transfer_encoding: [] - trailer: {} - host: api.bonsai.io - remote_addr: "" - request_uri: "" - body: '{"name":"bonsai-api-go-test-cluster-updated","plan":"standard-nano-comped"}' - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - bonsai-api-go/v1 bonsai-api-go/1.0.0 - url: https://api.bonsai.io/clusters/bonsai-api-go-2471463249 - method: PUT - response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked - trailer: {} - content_length: -1 - uncompressed: true - body: '{"message":"Your cluster is being updated.","monitor":"https://api.bonsai.io/clusters/bonsai-api-go-2471463249","status":202}' - headers: - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'' https:; font-src ''self'' https: data:; img-src ''self'' https: data:; object-src ''none''; script-src ''self'' https: ''unsafe-inline''; style-src ''self'' https: ''unsafe-inline''; connect-src ''self'' http: wss://*.bonsaisearch.net' - Content-Type: - - application/json; charset=utf-8 - Date: - - Sat, 04 May 2024 11:43:53 GMT - Referrer-Policy: - - strict-origin-when-cross-origin - Server: - - Cowboy - Strict-Transport-Security: - - max-age=63072000; includeSubDomains - Vary: - - Accept,Accept-Encoding - Via: - - 1.1 vegur - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - c95dcfbe-00c0-4dcc-a600-f366362c4073 - X-Runtime: - - "0.126076" + - "0.214722" X-Xss-Protection: - 1; mode=block status: 202 Accepted code: 202 - duration: 310.9072ms + duration: 478.9127ms diff --git a/bonsai/fixtures/vcr/TestPlanClient-All.yaml b/bonsai/fixtures/vcr/TestPlanClient-All.yaml index b9b2c6f..236f9d6 100644 --- a/bonsai/fixtures/vcr/TestPlanClient-All.yaml +++ b/bonsai/fixtures/vcr/TestPlanClient-All.yaml @@ -20,7 +20,7 @@ interactions: Content-Type: - application/json User-Agent: - - bonsai-api-go/v1 bonsai-api-go/1.0.0 + - bonsai-api-go/v2.2.0 bonsai-api-go/v2.2.0 url: https://api.bonsai.io/plans method: GET response: @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Sat, 04 May 2024 11:45:13 GMT + - Wed, 15 May 2024 01:18:46 GMT Etag: - W/"eb7ff9161ac36190f5335eeb3f123fa3" Referrer-Policy: @@ -65,11 +65,11 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 0b81e0d8-fe54-4ee4-ae00-22e37a0c08fe + - f9d1511a-8a0e-426e-b492-bc5ce18acd2c X-Runtime: - - "0.137879" + - "0.124419" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 - duration: 391.1983ms + duration: 374.3145ms diff --git a/bonsai/fixtures/vcr/TestPlanClient-GetByPath.yaml b/bonsai/fixtures/vcr/TestPlanClient-GetByPath.yaml index 3306de3..14f4861 100644 --- a/bonsai/fixtures/vcr/TestPlanClient-GetByPath.yaml +++ b/bonsai/fixtures/vcr/TestPlanClient-GetByPath.yaml @@ -20,7 +20,7 @@ interactions: Content-Type: - application/json User-Agent: - - bonsai-api-go/v1 bonsai-api-go/1.0.0 + - bonsai-api-go/v2.2.0 bonsai-api-go/v2.2.0 url: https://api.bonsai.io/plans/standard-micro-aws-us-east-1 method: GET response: @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Sat, 04 May 2024 11:45:18 GMT + - Wed, 15 May 2024 01:18:50 GMT Etag: - W/"b4359d6cf7e2ba32b5676a1136f6c033" Referrer-Policy: @@ -65,11 +65,11 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 2ddf841d-7b51-4dce-934b-3e67818e497a + - fddfb1bd-4012-468a-92fc-36f1f461d8e1 X-Runtime: - - "0.034832" + - "0.057551" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 - duration: 285.9613ms + duration: 237.8436ms diff --git a/bonsai/fixtures/vcr/TestReleaseClient-All.yaml b/bonsai/fixtures/vcr/TestReleaseClient-All.yaml index 9d6f37f..a05d113 100644 --- a/bonsai/fixtures/vcr/TestReleaseClient-All.yaml +++ b/bonsai/fixtures/vcr/TestReleaseClient-All.yaml @@ -20,7 +20,7 @@ interactions: Content-Type: - application/json User-Agent: - - bonsai-api-go/v1 bonsai-api-go/1.0.0 + - bonsai-api-go/v2.2.0 bonsai-api-go/v2.2.0 url: https://api.bonsai.io/releases method: GET response: @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Sat, 04 May 2024 11:45:08 GMT + - Wed, 15 May 2024 01:11:44 GMT Etag: - W/"d99fed993c4b49c72477901154e07d7a" Referrer-Policy: @@ -65,11 +65,11 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 612abd70-820a-468f-8c96-95c4767d1456 + - c0e6509f-d6e6-46e8-bde2-f13d03c46052 X-Runtime: - - "0.044478" + - "0.038938" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 - duration: 198.2537ms + duration: 227.2747ms diff --git a/bonsai/fixtures/vcr/TestReleaseClient-GetByPath.yaml b/bonsai/fixtures/vcr/TestReleaseClient-GetByPath.yaml index 8605693..dedcc1c 100644 --- a/bonsai/fixtures/vcr/TestReleaseClient-GetByPath.yaml +++ b/bonsai/fixtures/vcr/TestReleaseClient-GetByPath.yaml @@ -20,7 +20,7 @@ interactions: Content-Type: - application/json User-Agent: - - bonsai-api-go/v1 bonsai-api-go/1.0.0 + - bonsai-api-go/v2.2.0 bonsai-api-go/v2.2.0 url: https://api.bonsai.io/releases/opensearch-2.6.0-mt method: GET response: @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Sat, 04 May 2024 11:45:04 GMT + - Wed, 15 May 2024 01:11:47 GMT Etag: - W/"6f986805763c0fe363ac7d2d71e16321" Referrer-Policy: @@ -65,11 +65,11 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - e0e6cf3e-fa65-4edf-88b4-fb21536654aa + - 083e3aca-0dd9-4bc7-857b-dc7b95316421 X-Runtime: - - "0.037590" + - "0.041705" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 - duration: 218.2436ms + duration: 210.0072ms diff --git a/bonsai/fixtures/vcr/TestSpaceClient-All.yaml b/bonsai/fixtures/vcr/TestSpaceClient-All.yaml index 2a1dd96..5f8f054 100644 --- a/bonsai/fixtures/vcr/TestSpaceClient-All.yaml +++ b/bonsai/fixtures/vcr/TestSpaceClient-All.yaml @@ -20,7 +20,7 @@ interactions: Content-Type: - application/json User-Agent: - - bonsai-api-go/v1 bonsai-api-go/1.0.0 + - bonsai-api-go/v2.2.0 bonsai-api-go/v2.2.0 url: https://api.bonsai.io/spaces method: GET response: @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Sat, 04 May 2024 11:44:54 GMT + - Wed, 15 May 2024 01:07:33 GMT Etag: - W/"9ba8925afc58e91e133d9a2003ae88ed" Referrer-Policy: @@ -65,11 +65,11 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - abf6205a-c77e-4784-8137-85dd7d034836 + - d5fd0ed3-b888-45e7-8cf3-b6576b3fb4e5 X-Runtime: - - "0.182905" + - "0.053957" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 - duration: 434.5154ms + duration: 322.1804ms diff --git a/bonsai/fixtures/vcr/TestSpaceClient-GetByPath.yaml b/bonsai/fixtures/vcr/TestSpaceClient-GetByPath.yaml index d2dbcdf..e8d0f14 100644 --- a/bonsai/fixtures/vcr/TestSpaceClient-GetByPath.yaml +++ b/bonsai/fixtures/vcr/TestSpaceClient-GetByPath.yaml @@ -20,7 +20,7 @@ interactions: Content-Type: - application/json User-Agent: - - bonsai-api-go/v1 bonsai-api-go/1.0.0 + - bonsai-api-go/v2.2.0 bonsai-api-go/v2.2.0 url: https://api.bonsai.io/spaces/omc/bonsai/eu-west-1/common method: GET response: @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Sat, 04 May 2024 11:41:36 GMT + - Wed, 15 May 2024 01:07:56 GMT Etag: - W/"fd791cbb84387e9be5e89cb367a1fd95" Referrer-Policy: @@ -65,11 +65,11 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 93559cfc-0182-43b1-beb4-6c9f36075f3f + - b433f0d9-3928-44ef-a344-ff2748644bf9 X-Runtime: - - "0.057102" + - "0.038931" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 - duration: 459.6812ms + duration: 267.7967ms diff --git a/bonsai/plan.go b/bonsai/plan.go index 796373e..8c34233 100644 --- a/bonsai/plan.go +++ b/bonsai/plan.go @@ -34,12 +34,12 @@ type planAllResponse struct { // Indicates whether the plan is single-tenant or not. A value of false // indicates the Cluster will share hardware with other Clusters. Single // tenant environments can be reached via the public Internet. - SingleTenant bool `json:"single_tenant,omitempty"` + SingleTenant *bool `json:"single_tenant,omitempty"` // Indicates whether the plan is on a publicly addressable network. // Private plans provide environments that cannot be reached by the public // Internet. A VPC connection will be needed to communicate with a private // cluster. - PrivateNetwork bool `json:"private_network,omitempty"` + PrivateNetwork *bool `json:"private_network,omitempty"` // A collection of search release slugs available for the plan. Additional // information about a release can be retrieved from the Releases API. AvailableReleases []string `json:"available_releases"` @@ -105,12 +105,12 @@ type Plan struct { // Indicates whether the plan is single-tenant or not. A value of false // indicates the Cluster will share hardware with other Clusters. Single // tenant environments can be reached via the public Internet. - SingleTenant bool `json:"single_tenant,omitempty"` + SingleTenant *bool `json:"single_tenant,omitempty"` // Indicates whether the plan is on a publicly addressable network. // Private plans provide environments that cannot be reached by the public // Internet. A VPC connection will be needed to communicate with a private // cluster. - PrivateNetwork bool `json:"private_network,omitempty"` + PrivateNetwork *bool `json:"private_network,omitempty"` // A collection of search release slugs available for the plan. Additional // information about a release can be retrieved from the Releases API. AvailableReleases []Release `json:"available_releases"` diff --git a/bonsai/plan_impl_test.go b/bonsai/plan_impl_test.go index ddb950e..15b0ffe 100644 --- a/bonsai/plan_impl_test.go +++ b/bonsai/plan_impl_test.go @@ -39,8 +39,8 @@ func (s *ClientImplTestSuite) TestPlanAllResponseJsonUnmarshal() { Name: "Sandbox", PriceInCents: 0, BillingIntervalInMonths: 1, - SingleTenant: false, - PrivateNetwork: false, + SingleTenant: new(bool), + PrivateNetwork: new(bool), AvailableReleases: []string{ "elasticsearch-7.2.0", }, diff --git a/bonsai/plan_test.go b/bonsai/plan_test.go index c4f64fa..457b318 100644 --- a/bonsai/plan_test.go +++ b/bonsai/plan_test.go @@ -68,8 +68,8 @@ func (s *ClientMockTestSuite) TestPlanClient_All() { Name: "Sandbox", PriceInCents: 0, BillingIntervalInMonths: 1, - SingleTenant: false, - PrivateNetwork: false, + SingleTenant: new(bool), + PrivateNetwork: new(bool), AvailableReleases: []bonsai.Release{ // TODO: we'll see whether the response is actually a // shortened version like this or a slug @@ -92,8 +92,8 @@ func (s *ClientMockTestSuite) TestPlanClient_All() { Name: "Standard Small", PriceInCents: 5000, BillingIntervalInMonths: 1, - SingleTenant: false, - PrivateNetwork: false, + SingleTenant: Pointer(false), + PrivateNetwork: Pointer(false), AvailableReleases: []bonsai.Release{ {Slug: "elasticsearch-5.6.16"}, {Slug: "elasticsearch-6.8.3"}, @@ -155,8 +155,8 @@ func (s *ClientMockTestSuite) TestPlanClient_GetByPath() { Name: "Sandbox", PriceInCents: 0, BillingIntervalInMonths: 1, - SingleTenant: false, - PrivateNetwork: false, + SingleTenant: new(bool), + PrivateNetwork: new(bool), AvailableReleases: []bonsai.Release{ {Slug: "elasticsearch-7.2.0"}, }, diff --git a/bonsai/release.go b/bonsai/release.go index edcbee1..e1d26e2 100644 --- a/bonsai/release.go +++ b/bonsai/release.go @@ -18,7 +18,7 @@ type Release struct { Slug string `json:"slug,omitempty"` ServiceType string `json:"service_type,omitempty"` Version string `json:"version,omitempty"` - MultiTenant bool `json:"multitenant,omitempty"` + MultiTenant *bool `json:"multitenant,omitempty"` // A URI to retrieve more information about this Release. URI string `json:"uri,omitempty"` diff --git a/bonsai/release_test.go b/bonsai/release_test.go index e7e38a3..e629fb7 100644 --- a/bonsai/release_test.go +++ b/bonsai/release_test.go @@ -54,21 +54,21 @@ func (s *ClientMockTestSuite) TestReleaseClient_All() { Slug: "elasticsearch-5.6.16", ServiceType: "elasticsearch", Version: "5.6.16", - MultiTenant: true, + MultiTenant: Pointer(true), }, { Name: "Elasticsearch 6.5.4", Slug: "elasticsearch-6.5.4", ServiceType: "elasticsearch", Version: "6.5.4", - MultiTenant: true, + MultiTenant: Pointer(true), }, { Name: "Elasticsearch 7.2.0", Slug: "elasticsearch-7.2.0", ServiceType: "elasticsearch", Version: "7.2.0", - MultiTenant: true, + MultiTenant: Pointer(true), }, } releases, err := s.client.Release.All(context.Background()) @@ -108,7 +108,7 @@ func (s *ClientMockTestSuite) TestReleaseClient_GetBySlug() { Name: "Elasticsearch 7.2.0", ServiceType: "elasticsearch", Version: "7.2.0", - MultiTenant: true, + MultiTenant: Pointer(true), } resultResp, err := s.client.Release.GetBySlug(context.Background(), targetReleaseSlug) diff --git a/bonsai/space.go b/bonsai/space.go index 97c1342..c08467e 100644 --- a/bonsai/space.go +++ b/bonsai/space.go @@ -24,9 +24,9 @@ type CloudProvider struct { // Space represents the server groups and geographic regions available to their // account, where clusters may be provisioned. type Space struct { - Path string `json:"path"` - PrivateNetwork bool `json:"private_network"` - Cloud CloudProvider `json:"cloud,omitempty"` + Path string `json:"path"` + PrivateNetwork *bool `json:"private_network,omitempty"` + Cloud *CloudProvider `json:"cloud,omitempty"` // The geographic region in which the cluster is running. Region string `json:"region,omitempty"` diff --git a/bonsai/space_test.go b/bonsai/space_test.go index 6f8e4de..1785ce7 100644 --- a/bonsai/space_test.go +++ b/bonsai/space_test.go @@ -91,10 +91,10 @@ func (s *ClientMockTestSuite) TestSpaceClient_GetByPath() { space, err := s.client.Space.GetByPath(ctx, "omc/bonsai/us-east-1/common") s.NoError(err, "successfully get space by path") - s.Equal(space.Path, targetSpacePath) - s.Equal(space.PrivateNetwork, false) - s.Equal(space.Cloud.Provider, "aws") - s.Equal(space.Cloud.Region, "aws-us-east-1") + s.Equal(targetSpacePath, space.Path) + s.Equal(new(bool), space.PrivateNetwork) + s.Equal("aws", space.Cloud.Provider) + s.Equal("aws-us-east-1", space.Cloud.Region) } // VCR Tests.