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