|
| 1 | +# Changelog |
| 2 | + |
| 3 | +## Breaking changes |
| 4 | + |
| 5 | +### Improved api default values |
| 6 | + |
| 7 | +Changes the constructor behavior of `NewAPI` and the `Config` |
| 8 | +validation now only accepts an `auth.APIKey` or `*auth.APIKey` as the |
| 9 | +only valid AuthWriters for the API when the host is set to the ESS host |
| 10 | +(`https://api.elastic-cloud.com`). Also adds a constant: `ESSEndpoint`. |
| 11 | + |
| 12 | +Adds a new function to the `deploymentapi` pkg: `deploymentapi.RequestID` |
| 13 | +which will always return a request ID to be |
| 14 | +used in `deploymentapi.CreateParams`. It will either return an auto- |
| 15 | +generated string of 64 characters or the string argument which is passed |
| 16 | +to the function. |
| 17 | + |
| 18 | +Adds a new package called `deploymentsize` and a new function: |
| 19 | +`ParseGb` which will parse a string in the format of `<size>g`, into its |
| 20 | +value in megabytes as an int32. Valid examples of parseable sizes are in |
| 21 | +`0.5g` increments, with a minimum accepted size of `0.5g`. |
| 22 | + |
| 23 | +### Region is no longer a valid `api.Config` parameter |
| 24 | + |
| 25 | +The `Region` field on `api.Config` has been removed from the structure. |
| 26 | +Instead of using a global Region parameter, all APIs which require a region |
| 27 | +to be specified as a parameter, will expose a `Region` parameter to be used. |
| 28 | + |
| 29 | +## Notable changes |
| 30 | + |
| 31 | +### Changes to existing APIs |
| 32 | + |
| 33 | +#### Added PayloadOverrides to deploymentapi.Update() |
| 34 | + |
| 35 | +Modified the Update function parameters to allow the consumer to specify |
| 36 | +a PayloadOverrides which can be used to override nested values in the resources. |
| 37 | +Currently supports overrides for `Version`, `Name` and `Region`. |
| 38 | + |
| 39 | +#### Support redacted authorization headers |
| 40 | + |
| 41 | +Added a new configuration parameter `RedactAuth` to `api.VerboseSettings` |
| 42 | +when set, will replace the contents of the `Authorization` header with |
| 43 | +`[REDACTED]`. |
| 44 | + |
| 45 | +The default behavior still preserves the original contents of the header. |
| 46 | + |
| 47 | +#### Support for Enterprise Search on all APIs |
| 48 | + |
| 49 | +Adds support for the `enterprise_search` resource kind on all APIs, namely: |
| 50 | +deployment APIs, allocator vacate APIs and plan tracking functions. |
| 51 | + |
| 52 | +### New APIs |
| 53 | + |
| 54 | +#### Moved all APIs from ecctl to the cloud-sdk-go |
| 55 | + |
| 56 | +Packages previously published a public API through `ecctl/pkg/...`, have |
| 57 | +been move to the `cloud-sdk-go`, with an `api` suffix in the package name. |
| 58 | + |
| 59 | +The full list of packages which have been added as part of this change is: |
| 60 | + |
| 61 | +* [`pkg/api/platformapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/platformapi) |
| 62 | +* [`pkg/api/platformapi/configurationtemplateapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/platformapi/configurationtemplateapi) |
| 63 | +* [`pkg/api/platformapi/allocatorapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/platformapi/allocatorapi) |
| 64 | +* [`pkg/api/platformapi/instanceconfigapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/platformapi/instanceconfigapi) |
| 65 | +* [`pkg/api/platformapi/snaprepoapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/platformapi/snaprepoapi) |
| 66 | +* [`pkg/api/platformapi/enrollmenttokenapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/platformapi/enrollmenttokenapi) |
| 67 | +* [`pkg/api/platformapi/proxyapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/platformapi/proxyapi) |
| 68 | +* [`pkg/api/platformapi/proxyapi/filteredgroupapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/platformapi/proxyapi/filteredgroupapi) |
| 69 | +* [`pkg/api/platformapi/roleapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/platformapi/roleapi) |
| 70 | +* [`pkg/api/platformapi/runnerapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/platformapi/runnerapi) |
| 71 | +* [`pkg/api/platformapi/constructorapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/platformapi/constructorapi) |
| 72 | +* [`pkg/api/stackapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/stackapi) |
| 73 | +* [`pkg/api/userapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/userapi) |
| 74 | +* [`pkg/api/userapi/authapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/userapi/authapi) |
| 75 | +* [`pkg/api/userapi/authapi/adminapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/userapi/authapi/adminapi) |
| 76 | +* [`pkg/api/deploymentapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/deploymentapi) |
| 77 | +* [`pkg/api/deploymentapi/eskeystoreapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/deploymentapi/eskeystoreapi) |
| 78 | +* [`pkg/api/deploymentapi/noteapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/deploymentapi/noteapi) |
| 79 | +* [`pkg/api/deploymentapi/depresourceapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/deploymentapi/depresourceapi) |
| 80 | +* [`pkg/api/deploymentapi/deptemplateapi`](https://pkg.go.dev/github.com/elastic/cloud-sdk-go/pkg/api/deploymentapi/deptemplateapi) |
| 81 | + |
| 82 | +#### Added a api.WithRegion() function, allowing to set a region per API call |
| 83 | + |
| 84 | +Added a `context.Context` constructor (`api.WithRegion`) which creates a |
| 85 | +new context with a saved value equal to the passed region. This is meant |
| 86 | +to be used in any calls to the auto-generated API which are region-bound |
| 87 | +(any `/platform` APIs). |
| 88 | + |
| 89 | +When using `*api.CloudClientRuntime`, the path interpolation will take |
| 90 | +place without the need to explicitly handle it. |
| 91 | + |
| 92 | +This change allows the `*api.API` object to be used accross multiple |
| 93 | +regions rather than requiring a single instance of that structure per |
| 94 | +region. |
| 95 | + |
| 96 | +### Bug fixes |
| 97 | + |
| 98 | +#### API now handles certain API call string fields as "raw JSON" |
| 99 | + |
| 100 | +Adds certain handling of API operation string fields to be handled as raw |
| 101 | +JSON fields so that double quotes in said fields aren't escaped by the |
| 102 | +runtime, the excluded operations are: |
| 103 | + |
| 104 | +* `set-es-cluster-metadata-raw` |
| 105 | +* `update-user` |
| 106 | +* `update-current-user` |
| 107 | + |
| 108 | +### Testing |
| 109 | + |
| 110 | +#### Added support for request assertions on unit tests. |
| 111 | + |
| 112 | +Adds the ability to assert certain `*http.Request` fields which |
| 113 | +are sent to the http.RoundTripper on any of the request / reply flows |
| 114 | +which are tested and asserted in our unit tests. Since it's an optional |
| 115 | +field, it doesn't enforce that field to be set in the `mock.Response`, |
| 116 | +but rather make it optional for those tests where it makes sense to do so. |
| 117 | + |
| 118 | +#### Added `apivalidator` testing layer |
| 119 | + |
| 120 | +Added a new `apivalidator` executable: |
| 121 | + |
| 122 | +- A CLI running a series of requests based off a specified apidocs file |
| 123 | +(which can be either a local file or downloaded from it's location), against |
| 124 | +a prism API validation proxy, and then returns errors based on discrepancies. |
| 125 | + |
| 126 | +- A new Makefile with targets to start a prism validation proxy for the public |
| 127 | +API, another to run the validation tests against the proxy, and another to run |
| 128 | +both without having to start a new terminal and killing the server when it finishes. |
| 129 | + |
| 130 | +Additionally, these tests are now run on every `make swagger` to verify endpoint |
| 131 | +availability when new `client` and `models` are generated from a swagger spec. |
| 132 | + |
| 133 | +### Detailed changes |
| 134 | +<!-- AUTOGENERATED COMMIT LIST --> |
| 135 | + |
| 136 | +* 43417a5 deploymentsize: Fixes a bug in ParseGb() (#183) |
| 137 | +* 7ae1b54 depresourceapi: Change the 'Name' field in ElasticsearchTopologyElement for 'NodeType' (#182) |
| 138 | +* e188910 deploymentapi: Add NewUpdateRequest function (#181) |
| 139 | +* e81a08e deploymentapi: Support List and filter templates (#178) |
| 140 | +* ae68d8e docs: Add cloud-sdk-go specific styleguide (#177) |
| 141 | +* 0fc2167 build(deps): bump github.com/go-openapi/runtime from 0.19.19 to 0.19.20 (#176) |
| 142 | +* 70be0df eskeystoreapi: Implement Deployment Keystore APIs (#175) |
| 143 | +* 08bd5e8 docs: Improve README and CONTRIBUTING docs with updated information (#173) |
| 144 | +* c649b4a depresourceapi: Update resource APIs to use new deployment template endpoint (#174) |
| 145 | +* a17949f deptemplateapi: Add all CRUD APIs (#171) |
| 146 | +* 1dea05b deploymentapi: Support for Enterprise Search and refactor (#170) |
| 147 | +* e84f2de deploymentapi: create refactor and Enterprise Search support (#168) |
| 148 | +* b218e6c apivalidator: Modifies the request builder to take into account required query (#169) |
| 149 | +* eeaf367 apidocs: Update to 2.6.0 and generate client/models (#167) |
| 150 | +* 60f7acf apivalidator: Add empty body to PATCH requests (#166) |
| 151 | +* f1d68b8 api: Update client/models to MS39 (#165) |
| 152 | +* 16b8efa test: introduce CLI/tests for validating API spec against live API and run on 'make swagger' (#163) |
| 153 | +* 74b7134 configurationtemplateapi: Add Format field (#162) |
| 154 | +* 0885acb userapi: Moves user APIs from ecctl (#155) |
| 155 | +* e4bf2e5 stackapi: Move stackapi up one level (#158) |
| 156 | +* bd9a9bf api: Add mock.RoundTripper to transport workflow (#157) |
| 157 | +* 2b4d72f api: Add global route mappings and require region (#156) |
| 158 | +* 4f4cc2a instanceconfigapi: Add region parameter to APIs (#152) |
| 159 | +* a8fd838 allocator vacate: Add enterprise search support (#151) |
| 160 | +* 63de1c4 client/models: Revert to 2.5.0-ms36 (#154) |
| 161 | +* 41bc7ff api: Update API spec and generate client/models ms39 (#150) |
| 162 | +* dd18ac5 proxyapi: Add Region field and WithRegion ctx (#149) |
| 163 | +* 8744064 platformapi: Add region parameter to all APIs (#148) |
| 164 | +* 31d422e filteredgroupapi: Add Region field and WithRegion ctx (#144) |
| 165 | +* 1e53d46 template: Add region parameter to all APIs (#146) |
| 166 | +* c662e41 roleapi: Add Region field and WithRegion ctx (#139) |
| 167 | +* 6982df8 runnerapi: Add Region field and WithRegion ctx (#138) |
| 168 | +* 470a54b enrollmenttokenapi:Add Region param and WithRegion (#137) |
| 169 | +* 9b83405 snaprepoapi: Add Region field and WithRegion ctx (#136) |
| 170 | +* af13daa constructorapi: Add Region param and WithRegion (#135) |
| 171 | +* ecad4ea stackapi: Add Region field and WithRegion ctx (#134) |
| 172 | +* 5771a04 allocatorapi: Add Region param and WithRegion ctx (#133) |
| 173 | +* c2384eb api: Export default mock headers and host (#131) |
| 174 | +* d0ce494 ec: Add ValidateRegionSet ensuring a region is set (#130) |
| 175 | +* d8bc0d1 api: migrate all platform apis from ecctl (#125) |
| 176 | +* d694acb api: Add WithRegion context for region bound calls (#124) |
| 177 | +* 6e12415 api: Add RedactAuth bool option to VerboseSettings (#123) |
| 178 | +* f16056b deploymentsize: change Parse to only accept g (#111) |
| 179 | +* 453072f build(deps): bump github.com/mitchellh/mapstructure from 1.3.1 to 1.3.2 (#126) |
| 180 | +* 008a019 build(deps): bump github.com/stretchr/testify from 1.6.0 to 1.6.1 (#127) |
| 181 | +* a962b80 mock: Add url Query assertion (#122) |
| 182 | +* 0dc94bf api: NewMock now uses NewAPI as the constructor (#120) |
| 183 | +* c272baf build(deps): bump github.com/stretchr/testify from 1.5.1 to 1.6.0 (#119) |
| 184 | +* ce472ea api: transport now handles raw metadata producer (#118) |
| 185 | +* 72b2e08 build(deps): bump github.com/stretchr/testify from 1.4.0 to 1.5.1 (#117) |
| 186 | +* 84bd8e5 mock: Add ability to assert received *http.Request (#116) |
| 187 | +* 5b0f708 build(deps): bump github.com/mitchellh/mapstructure from 1.3.0 to 1.3.1 (#115) |
| 188 | +* 60b0cbb api: Use http.Transport.Clone() for new transports (#114) |
| 189 | +* 99a190e deploymentapi: Allow overrides on Update operation (#113) |
| 190 | +* 45fcfe4 api: Fix transport error on UserAgentTransport (#112) |
| 191 | +* f934e7f ec: Add missing rand unit tests (#108) |
| 192 | +* 6360cad build(deps): bump github.com/go-openapi/spec from 0.19.7 to 0.19.8 (#109) |
| 193 | +* f2bf721 ec: Seed random so randoms actually are random (#107) |
| 194 | +* 9389cc7 api: Add better API defaults and helpers (#106) |
| 195 | +* 02ebae4 plan: Use local multierror.Prefixed as multierror (#104) |
| 196 | +* ad18b90 api: Add deploymentapi and subpackages from ecctl (#105) |
| 197 | +* 1356757 build(deps): bump github.com/mitchellh/mapstructure from 1.2.3 to 1.3.0 (#100) |
| 198 | +* 70af65b api: Move LoginUser from ecctl codebase (#101) |
| 199 | +* f7e06bf misc: update issue template labels (#102) |
| 200 | +* 8730526 build(deps): bump github.com/mitchellh/mapstructure from 1.2.2 to 1.2.3 (#99) |
0 commit comments