From 6e3989098c4fc1f88a325043a7340c897c2a7c05 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Sep 2023 04:27:16 +0000 Subject: [PATCH] Bump github.com/elastic/go-elasticsearch/v6 from 6.8.2 to 6.8.10 Bumps [github.com/elastic/go-elasticsearch/v6](https://github.com/elastic/go-elasticsearch) from 6.8.2 to 6.8.10. - [Release notes](https://github.com/elastic/go-elasticsearch/releases) - [Changelog](https://github.com/elastic/go-elasticsearch/blob/main/CHANGELOG.md) - [Commits](https://github.com/elastic/go-elasticsearch/compare/v6.8.2...v6.8.10) --- updated-dependencies: - dependency-name: github.com/elastic/go-elasticsearch/v6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 23 +- .../elastic/go-elasticsearch/v6/.travis.yml | 172 --------- .../elastic/go-elasticsearch/v6/Dockerfile | 2 +- .../elastic/go-elasticsearch/v6/Makefile | 159 ++++---- .../elastic/go-elasticsearch/v6/README.md | 47 ++- .../elastic/go-elasticsearch/v6/doc.go | 7 +- .../go-elasticsearch/v6/elasticsearch.go | 149 +++++++- .../go-elasticsearch/v6/esapi/api._.go | 246 ++++++++++++- .../go-elasticsearch/v6/esapi/api.bulk.go | 22 +- .../v6/esapi/api.cat.aliases.go | 22 +- .../v6/esapi/api.cat.allocation.go | 22 +- .../v6/esapi/api.cat.count.go | 22 +- .../v6/esapi/api.cat.fielddata.go | 22 +- .../v6/esapi/api.cat.health.go | 22 +- .../go-elasticsearch/v6/esapi/api.cat.help.go | 22 +- .../v6/esapi/api.cat.indices.go | 22 +- .../v6/esapi/api.cat.master.go | 22 +- .../v6/esapi/api.cat.nodeattrs.go | 22 +- .../v6/esapi/api.cat.nodes.go | 22 +- .../v6/esapi/api.cat.pending_tasks.go | 22 +- .../v6/esapi/api.cat.plugins.go | 22 +- .../v6/esapi/api.cat.recovery.go | 22 +- .../v6/esapi/api.cat.repositories.go | 22 +- .../v6/esapi/api.cat.segments.go | 22 +- .../v6/esapi/api.cat.shards.go | 22 +- .../v6/esapi/api.cat.snapshots.go | 22 +- .../v6/esapi/api.cat.tasks.go | 22 +- .../v6/esapi/api.cat.templates.go | 22 +- .../v6/esapi/api.cat.thread_pool.go | 22 +- .../v6/esapi/api.clear_scroll.go | 22 +- .../esapi/api.cluster.allocation_explain.go | 22 +- .../v6/esapi/api.cluster.get_settings.go | 22 +- .../v6/esapi/api.cluster.health.go | 22 +- .../v6/esapi/api.cluster.pending_tasks.go | 22 +- .../v6/esapi/api.cluster.put_settings.go | 22 +- .../v6/esapi/api.cluster.remote_info.go | 22 +- .../v6/esapi/api.cluster.reroute.go | 22 +- .../v6/esapi/api.cluster.state.go | 22 +- .../v6/esapi/api.cluster.stats.go | 22 +- .../go-elasticsearch/v6/esapi/api.count.go | 22 +- .../go-elasticsearch/v6/esapi/api.create.go | 22 +- .../go-elasticsearch/v6/esapi/api.delete.go | 22 +- .../v6/esapi/api.delete_by_query.go | 22 +- .../esapi/api.delete_by_query_rethrottle.go | 22 +- .../v6/esapi/api.delete_script.go | 22 +- .../go-elasticsearch/v6/esapi/api.exists.go | 22 +- .../v6/esapi/api.exists_source.go | 22 +- .../go-elasticsearch/v6/esapi/api.explain.go | 22 +- .../v6/esapi/api.field_caps.go | 22 +- .../go-elasticsearch/v6/esapi/api.get.go | 22 +- .../v6/esapi/api.get_script.go | 22 +- .../v6/esapi/api.get_source.go | 22 +- .../go-elasticsearch/v6/esapi/api.index.go | 22 +- .../v6/esapi/api.indices.analyze.go | 22 +- .../v6/esapi/api.indices.clear_cache.go | 44 ++- .../v6/esapi/api.indices.close.go | 22 +- .../v6/esapi/api.indices.create.go | 22 +- .../v6/esapi/api.indices.delete.go | 22 +- .../v6/esapi/api.indices.delete_alias.go | 22 +- .../v6/esapi/api.indices.delete_template.go | 22 +- .../v6/esapi/api.indices.exists.go | 22 +- .../v6/esapi/api.indices.exists_alias.go | 22 +- .../v6/esapi/api.indices.exists_template.go | 22 +- .../v6/esapi/api.indices.exists_type.go | 22 +- .../v6/esapi/api.indices.flush.go | 22 +- .../v6/esapi/api.indices.flush_synced.go | 22 +- .../v6/esapi/api.indices.forcemerge.go | 22 +- .../v6/esapi/api.indices.get.go | 22 +- .../v6/esapi/api.indices.get_alias.go | 22 +- .../v6/esapi/api.indices.get_field_mapping.go | 22 +- .../v6/esapi/api.indices.get_mapping.go | 22 +- .../v6/esapi/api.indices.get_settings.go | 22 +- .../v6/esapi/api.indices.get_template.go | 22 +- .../v6/esapi/api.indices.get_upgrade.go | 22 +- .../v6/esapi/api.indices.open.go | 22 +- .../v6/esapi/api.indices.put_alias.go | 22 +- .../v6/esapi/api.indices.put_mapping.go | 22 +- .../v6/esapi/api.indices.put_settings.go | 22 +- .../v6/esapi/api.indices.put_template.go | 22 +- .../v6/esapi/api.indices.recovery.go | 22 +- .../v6/esapi/api.indices.refresh.go | 22 +- .../v6/esapi/api.indices.rollover.go | 22 +- .../v6/esapi/api.indices.segments.go | 22 +- .../v6/esapi/api.indices.shard_stores.go | 22 +- .../v6/esapi/api.indices.shrink.go | 22 +- .../v6/esapi/api.indices.split.go | 22 +- .../v6/esapi/api.indices.stats.go | 22 +- .../v6/esapi/api.indices.update_aliases.go | 22 +- .../v6/esapi/api.indices.upgrade.go | 22 +- .../v6/esapi/api.indices.validate_query.go | 22 +- .../go-elasticsearch/v6/esapi/api.info.go | 22 +- .../v6/esapi/api.ingest.delete_pipeline.go | 22 +- .../v6/esapi/api.ingest.get_pipeline.go | 22 +- .../v6/esapi/api.ingest.processor_grok.go | 22 +- .../v6/esapi/api.ingest.put_pipeline.go | 22 +- .../v6/esapi/api.ingest.simulate.go | 22 +- .../go-elasticsearch/v6/esapi/api.mget.go | 22 +- .../go-elasticsearch/v6/esapi/api.msearch.go | 22 +- .../v6/esapi/api.msearch_template.go | 22 +- .../v6/esapi/api.mtermvectors.go | 22 +- .../v6/esapi/api.nodes.hot_threads.go | 22 +- .../v6/esapi/api.nodes.info.go | 22 +- .../esapi/api.nodes.reload_secure_settings.go | 22 +- .../v6/esapi/api.nodes.stats.go | 22 +- .../v6/esapi/api.nodes.usage.go | 22 +- .../go-elasticsearch/v6/esapi/api.ping.go | 22 +- .../v6/esapi/api.put_script.go | 22 +- .../v6/esapi/api.rank_eval.go | 22 +- .../go-elasticsearch/v6/esapi/api.reindex.go | 22 +- .../v6/esapi/api.reindex_rethrottle.go | 22 +- .../v6/esapi/api.render_search_template.go | 22 +- .../v6/esapi/api.scripts_painless_execute.go | 22 +- .../go-elasticsearch/v6/esapi/api.scroll.go | 22 +- .../go-elasticsearch/v6/esapi/api.search.go | 22 +- .../v6/esapi/api.search_shards.go | 22 +- .../v6/esapi/api.search_template.go | 22 +- .../v6/esapi/api.snapshot.create.go | 22 +- .../esapi/api.snapshot.create_repository.go | 22 +- .../v6/esapi/api.snapshot.delete.go | 22 +- .../esapi/api.snapshot.delete_repository.go | 22 +- .../v6/esapi/api.snapshot.get.go | 22 +- .../v6/esapi/api.snapshot.get_repository.go | 22 +- .../v6/esapi/api.snapshot.restore.go | 22 +- .../v6/esapi/api.snapshot.status.go | 22 +- .../esapi/api.snapshot.verify_repository.go | 22 +- .../v6/esapi/api.tasks.cancel.go | 22 +- .../v6/esapi/api.tasks.get.go | 22 +- .../v6/esapi/api.tasks.list.go | 22 +- .../v6/esapi/api.termvectors.go | 22 +- .../go-elasticsearch/v6/esapi/api.update.go | 22 +- .../v6/esapi/api.update_by_query.go | 22 +- .../esapi/api.update_by_query_rethrottle.go | 22 +- ...pi.xpack.ccr.delete_auto_follow_pattern.go | 22 +- .../v6/esapi/api.xpack.ccr.follow.go | 22 +- .../v6/esapi/api.xpack.ccr.follow_info.go | 22 +- .../v6/esapi/api.xpack.ccr.follow_stats.go | 22 +- .../v6/esapi/api.xpack.ccr.forget_follower.go | 22 +- .../api.xpack.ccr.get_auto_follow_pattern.go | 22 +- .../v6/esapi/api.xpack.ccr.pause_follow.go | 22 +- .../api.xpack.ccr.put_auto_follow_pattern.go | 22 +- .../v6/esapi/api.xpack.ccr.resume_follow.go | 22 +- .../v6/esapi/api.xpack.ccr.stats.go | 22 +- .../v6/esapi/api.xpack.ccr.unfollow.go | 22 +- .../esapi/api.xpack.ilm.delete_lifecycle.go | 22 +- .../esapi/api.xpack.ilm.explain_lifecycle.go | 22 +- .../v6/esapi/api.xpack.ilm.get_lifecycle.go | 22 +- .../v6/esapi/api.xpack.ilm.get_status.go | 22 +- .../v6/esapi/api.xpack.ilm.move_to_step.go | 22 +- .../v6/esapi/api.xpack.ilm.put_lifecycle.go | 22 +- .../v6/esapi/api.xpack.ilm.remove_policy.go | 22 +- .../v6/esapi/api.xpack.ilm.retry.go | 22 +- .../v6/esapi/api.xpack.ilm.start.go | 22 +- .../v6/esapi/api.xpack.ilm.stop.go | 22 +- .../v6/esapi/api.xpack.indices.freeze.go | 22 +- .../v6/esapi/api.xpack.indices.unfreeze.go | 22 +- .../api.xpack.security.create_api_key.go | 22 +- .../esapi/api.xpack.security.get_api_key.go | 22 +- .../api.xpack.security.invalidate_api_key.go | 22 +- .../v6/esapi/api.xpack.xpack.graph.explore.go | 22 +- .../v6/esapi/api.xpack.xpack.info.go | 22 +- .../esapi/api.xpack.xpack.license.delete.go | 22 +- .../v6/esapi/api.xpack.xpack.license.get.go | 22 +- ...pi.xpack.xpack.license.get_basic_status.go | 22 +- ...pi.xpack.xpack.license.get_trial_status.go | 22 +- .../v6/esapi/api.xpack.xpack.license.post.go | 22 +- ...pi.xpack.xpack.license.post_start_basic.go | 22 +- ...pi.xpack.xpack.license.post_start_trial.go | 22 +- .../api.xpack.xpack.migration.deprecations.go | 22 +- ...pi.xpack.xpack.migration.get_assistance.go | 22 +- .../api.xpack.xpack.migration.upgrade.go | 22 +- .../v6/esapi/api.xpack.xpack.ml.close_job.go | 22 +- .../api.xpack.xpack.ml.delete_calendar.go | 22 +- ...pi.xpack.xpack.ml.delete_calendar_event.go | 22 +- .../api.xpack.xpack.ml.delete_calendar_job.go | 22 +- .../api.xpack.xpack.ml.delete_datafeed.go | 22 +- .../api.xpack.xpack.ml.delete_expired_data.go | 22 +- .../esapi/api.xpack.xpack.ml.delete_filter.go | 22 +- .../api.xpack.xpack.ml.delete_forecast.go | 22 +- .../v6/esapi/api.xpack.xpack.ml.delete_job.go | 22 +- ...pi.xpack.xpack.ml.delete_model_snapshot.go | 22 +- .../api.xpack.xpack.ml.find_file_structure.go | 22 +- .../v6/esapi/api.xpack.xpack.ml.flush_job.go | 22 +- .../v6/esapi/api.xpack.xpack.ml.forecast.go | 22 +- .../esapi/api.xpack.xpack.ml.get_buckets.go | 22 +- .../api.xpack.xpack.ml.get_calendar_events.go | 22 +- .../esapi/api.xpack.xpack.ml.get_calendars.go | 22 +- .../api.xpack.xpack.ml.get_categories.go | 22 +- .../api.xpack.xpack.ml.get_datafeed_stats.go | 22 +- .../esapi/api.xpack.xpack.ml.get_datafeeds.go | 22 +- .../esapi/api.xpack.xpack.ml.get_filters.go | 22 +- .../api.xpack.xpack.ml.get_influencers.go | 22 +- .../esapi/api.xpack.xpack.ml.get_job_stats.go | 22 +- .../v6/esapi/api.xpack.xpack.ml.get_jobs.go | 22 +- .../api.xpack.xpack.ml.get_model_snapshots.go | 22 +- .../api.xpack.xpack.ml.get_overall_buckets.go | 22 +- .../esapi/api.xpack.xpack.ml.get_records.go | 22 +- .../v6/esapi/api.xpack.xpack.ml.info.go | 22 +- .../v6/esapi/api.xpack.xpack.ml.open_job.go | 22 +- ...api.xpack.xpack.ml.post_calendar_events.go | 22 +- .../v6/esapi/api.xpack.xpack.ml.post_data.go | 22 +- .../api.xpack.xpack.ml.preview_datafeed.go | 22 +- .../esapi/api.xpack.xpack.ml.put_calendar.go | 22 +- .../api.xpack.xpack.ml.put_calendar_job.go | 22 +- .../esapi/api.xpack.xpack.ml.put_datafeed.go | 22 +- .../v6/esapi/api.xpack.xpack.ml.put_filter.go | 22 +- .../v6/esapi/api.xpack.xpack.ml.put_job.go | 22 +- ...pi.xpack.xpack.ml.revert_model_snapshot.go | 22 +- .../api.xpack.xpack.ml.set_upgrade_mode.go | 22 +- .../api.xpack.xpack.ml.start_datafeed.go | 22 +- .../esapi/api.xpack.xpack.ml.stop_datafeed.go | 22 +- .../api.xpack.xpack.ml.update_datafeed.go | 22 +- .../esapi/api.xpack.xpack.ml.update_filter.go | 22 +- .../v6/esapi/api.xpack.xpack.ml.update_job.go | 22 +- ...pi.xpack.xpack.ml.update_model_snapshot.go | 22 +- .../v6/esapi/api.xpack.xpack.ml.validate.go | 22 +- .../api.xpack.xpack.ml.validate_detector.go | 22 +- .../esapi/api.xpack.xpack.monitoring.bulk.go | 22 +- .../api.xpack.xpack.rollup.delete_job.go | 22 +- .../esapi/api.xpack.xpack.rollup.get_jobs.go | 22 +- .../api.xpack.xpack.rollup.get_rollup_caps.go | 22 +- ...pack.xpack.rollup.get_rollup_index_caps.go | 22 +- .../esapi/api.xpack.xpack.rollup.put_job.go | 22 +- .../api.xpack.xpack.rollup.rollup_search.go | 22 +- .../esapi/api.xpack.xpack.rollup.start_job.go | 22 +- .../esapi/api.xpack.xpack.rollup.stop_job.go | 22 +- .../api.xpack.xpack.security.authenticate.go | 22 +- ...pi.xpack.xpack.security.change_password.go | 22 +- ...pack.xpack.security.clear_cached_realms.go | 22 +- ...xpack.xpack.security.clear_cached_roles.go | 22 +- ....xpack.xpack.security.delete_privileges.go | 22 +- .../api.xpack.xpack.security.delete_role.go | 22 +- ...pack.xpack.security.delete_role_mapping.go | 22 +- .../api.xpack.xpack.security.delete_user.go | 22 +- .../api.xpack.xpack.security.disable_user.go | 22 +- .../api.xpack.xpack.security.enable_user.go | 22 +- ...api.xpack.xpack.security.get_privileges.go | 22 +- .../api.xpack.xpack.security.get_role.go | 22 +- ...i.xpack.xpack.security.get_role_mapping.go | 22 +- .../api.xpack.xpack.security.get_token.go | 22 +- .../api.xpack.xpack.security.get_user.go | 22 +- ...pack.xpack.security.get_user_privileges.go | 22 +- ...api.xpack.xpack.security.has_privileges.go | 22 +- ...i.xpack.xpack.security.invalidate_token.go | 22 +- ...api.xpack.xpack.security.put_privileges.go | 22 +- .../api.xpack.xpack.security.put_role.go | 22 +- ...i.xpack.xpack.security.put_role_mapping.go | 22 +- .../api.xpack.xpack.security.put_user.go | 22 +- .../esapi/api.xpack.xpack.sql.clear_cursor.go | 22 +- .../v6/esapi/api.xpack.xpack.sql.query.go | 22 +- .../v6/esapi/api.xpack.xpack.sql.translate.go | 22 +- .../esapi/api.xpack.xpack.ssl.certificates.go | 22 +- .../v6/esapi/api.xpack.xpack.usage.go | 22 +- .../api.xpack.xpack.watcher.ack_watch.go | 22 +- .../api.xpack.xpack.watcher.activate_watch.go | 22 +- ...pi.xpack.xpack.watcher.deactivate_watch.go | 22 +- .../api.xpack.xpack.watcher.delete_watch.go | 22 +- .../api.xpack.xpack.watcher.execute_watch.go | 22 +- .../api.xpack.xpack.watcher.get_watch.go | 22 +- .../api.xpack.xpack.watcher.put_watch.go | 22 +- .../esapi/api.xpack.xpack.watcher.restart.go | 22 +- .../v6/esapi/api.xpack.xpack.watcher.start.go | 22 +- .../v6/esapi/api.xpack.xpack.watcher.stats.go | 22 +- .../v6/esapi/api.xpack.xpack.watcher.stop.go | 22 +- .../elastic/go-elasticsearch/v6/esapi/doc.go | 5 +- .../go-elasticsearch/v6/esapi/esapi.go | 4 + .../v6/esapi/esapi.request.go | 35 +- .../v6/esapi/esapi.response.go | 54 ++- .../v6/estransport/connection.go | 316 ++++++++++++++++ .../v6/estransport/discovery.go | 205 +++++++++++ .../go-elasticsearch/v6/estransport/doc.go | 27 +- .../v6/estransport/estransport.go | 346 +++++++++++++++--- .../go-elasticsearch/v6/estransport/logger.go | 61 ++- .../v6/estransport/metrics.go | 181 +++++++++ .../v6/estransport/selector.go | 54 --- .../v6/internal/version/version.go | 6 +- vendor/modules.txt | 2 +- 277 files changed, 6765 insertions(+), 970 deletions(-) delete mode 100644 vendor/github.com/elastic/go-elasticsearch/v6/.travis.yml create mode 100644 vendor/github.com/elastic/go-elasticsearch/v6/estransport/connection.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v6/estransport/discovery.go create mode 100644 vendor/github.com/elastic/go-elasticsearch/v6/estransport/metrics.go delete mode 100644 vendor/github.com/elastic/go-elasticsearch/v6/estransport/selector.go diff --git a/go.mod b/go.mod index 5d41c7261..947cb5351 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/creack/pty v1.1.18 github.com/docker/docker v20.10.17+incompatible github.com/dustin/go-humanize v1.0.0 - github.com/elastic/go-elasticsearch/v6 v6.8.2 + github.com/elastic/go-elasticsearch/v6 v6.8.10 github.com/fsouza/go-dockerclient v1.4.2 github.com/gobuffalo/packr v1.30.1 github.com/gobwas/glob v0.2.3 diff --git a/go.sum b/go.sum index 576550eb1..3cfba44ee 100644 --- a/go.sum +++ b/go.sum @@ -27,10 +27,7 @@ cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+Y cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= -cloud.google.com/go v0.100.2 h1:t9Iw5QH5v4XtlEQaCtUY7x6sCABps8sW0acw7e2WQ6Y= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0 h1:DAq3r8y4mDgyB/ZPJ9v/5VJNqjgJAxTn6ZYLlUywOu8= cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1 h1:vpK6iQWv/2uUeFJth4/cBHsQAGjn1iIE6AAlxipRaA0= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= @@ -44,14 +41,12 @@ cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTB cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1 h1:2sMmt8prCn7DPaG4Pmh0N3Inmc8cT8ae5k1M6VJ9Wqc= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0 h1:v/k9Eueb8aAJ0vZuxKMrgm6kPhCLZU9HxFU+AFDs9Uk= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/iam v0.1.1/go.mod h1:CKqrcnI/suGpybEHxZ7BMehL0oA4LpdyJdUlTl9jVMw= cloud.google.com/go/iam v0.3.0 h1:exkAomrVUuzx9kWFI1wm3KI0uoDeUFPB4kKGzx6x+Gc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -63,9 +58,6 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.20.0 h1:kv3rQ3clEQdxqokkCCgQo+bxPqcuXiROjxvnKb8Oqdk= -cloud.google.com/go/storage v1.20.0/go.mod h1:TiC1o6FxNCG8y5gB7rqCsFZCIYPMPZCO81ppOoEPLGI= -cloud.google.com/go/storage v1.22.1 h1:F6IlQJZrZM++apn9V5/VfS3gbTUYg98PS3EMQAzqtfg= cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0 h1:wWRIaDURQA8xxHguFCshYepGlrWIrbBnAmc7wfg07qY= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= @@ -202,7 +194,6 @@ github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0Bsq github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cert-manager/cert-manager v1.9.2/go.mod h1:Bs3WsNX1LPKTs3boh//p7jLOn6ZRGEPz99ITeZU0g3c= github.com/cert-manager/cert-manager v1.10.2 h1:2/QH9C8ffeB+t8xHYsITkY2d9ulye9a5mi1F7o+MmC0= github.com/cert-manager/cert-manager v1.10.2/go.mod h1:v3T3yAt5ASv4/9cbO42EilLsoZDlybQrh8o6RhTw/vo= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -407,8 +398,8 @@ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3 github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/elastic/go-elasticsearch/v6 v6.8.2 h1:rp5DGrd63V5c6nHLjF6QEXUpZSvs0+QM3ld7m9VhV2g= -github.com/elastic/go-elasticsearch/v6 v6.8.2/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI= +github.com/elastic/go-elasticsearch/v6 v6.8.10 h1:2lN0gJ93gMBXvkhwih5xquldszpm8FlUwqG5sPzr6a8= +github.com/elastic/go-elasticsearch/v6 v6.8.10/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= @@ -1197,7 +1188,6 @@ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= @@ -1316,7 +1306,6 @@ golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1464,8 +1453,6 @@ google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqiv google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.64.0/go.mod h1:931CdxA8Rm4t6zqTFGSsgwbAEZ2+GMYurbndwSimebM= -google.golang.org/api v0.66.0/go.mod h1:I1dmXYpX7HGwz/ejRxwQp2qj5bFAz93HiCU1C1oYd9M= google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= @@ -1473,9 +1460,7 @@ google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRR google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.84.0 h1:NMB9J4cCxs9xEm+1Z9QiO3eFvn7EnQj3Eo3hN6ugVlg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0 h1:8rJoHuRxx+vCmZtAO/3k1dRLvYNVyTJtZ5oaFZvhgvc= google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= google.golang.org/api v0.97.0 h1:x/vEL1XDF/2V4xzdNgFPaKHluRESo2aTsL7QzHnBtGQ= google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= @@ -1554,12 +1539,8 @@ google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220111164026-67b88f271998/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220114231437-d2e6a121cae0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220201184016-50beb8ab5c44/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/.travis.yml b/vendor/github.com/elastic/go-elasticsearch/v6/.travis.yml deleted file mode 100644 index 20f6694fd..000000000 --- a/vendor/github.com/elastic/go-elasticsearch/v6/.travis.yml +++ /dev/null @@ -1,172 +0,0 @@ -dist: xenial - -language: go - -services: - - docker - -branches: - only: - - master - - travis - -install: true - -matrix: - fast_finish: true - allow_failures: - - os: windows - include: - - name: Unit Tests | Linux, go:stable, gomod=on - os: linux - go: stable - env: GO111MODULE=on TEST_SUITE=unit - script: - - go mod verify - - go build -v ./... - - make lint - - gotestsum --format=short-verbose --junitfile=/tmp/unit-junit.xml -- -coverprofile=/tmp/unit.cov -tags='unit' -timeout=1h -v ./... - after_script: - - test -f /tmp/unit.cov && bash <(curl -s https://codecov.io/bash) -f /tmp/unit.cov - - - name: Unit Tests | Linux, go:stable, gomod=off - os: linux - go: stable - env: GO111MODULE=off TEST_SUITE=unit - before_install: - - go get -u golang.org/x/lint/golint - - go get -u gotest.tools/gotestsum - install: - - go get -v ./... - script: - - go build -v ./... - - make lint - - gotestsum --format=short-verbose --junitfile=/tmp/unit-junit.xml -- -tags='unit' -timeout=1h -v ./... - - - name: Unit Tests | OS X, go:stable, gomod=on - os: osx - go: stable - env: GO111MODULE=on TEST_SUITE=unit - script: - - go mod verify - - go build -v ./... - - gotestsum --format=short-verbose --junitfile=/tmp/unit-junit.xml -- --tags='unit' --timeout=1h -v ./... - - - name: Unit Tests | Windows, go:stable, gomod=on - os: windows - go: stable - env: GO111MODULE=on TEST_SUITE=unit - script: - - go mod verify - - go build -v ./... - - gotestsum --format=short-verbose --junitfile=/tmp/unit-junit.xml -- -tags='unit' -timeout=1h -v ./... - - - name: Unit Tests | Linux, go:master, gomod=on - os: linux - go: master - env: GO111MODULE=on TEST_SUITE=unit - script: - - go mod verify - - go build -v ./... - - make lint - - gotestsum --format=short-verbose --junitfile=/tmp/unit-junit.xml -- -tags='unit' -timeout=1h -v ./... - - - name: Unit Tests | Docker/Linux, golang:1-alpine - os: linux - env: TEST_SUITE=unit - before_install: true - script: - - grep 'FROM' Dockerfile - - docker build --file Dockerfile --tag elastic/go-elasticsearch . - - echo $(($(docker image inspect -f '{{.Size}}' elastic/go-elasticsearch)/(1000*1000)))MB - - docker run -ti elastic/go-elasticsearch make lint - - docker run -ti elastic/go-elasticsearch make test - - - name: Integration Tests | Linux, go:stable - os: linux - go: stable - env: GO111MODULE=on TEST_SUITE=integration-client - before_script: - - docker pull docker.elastic.co/elasticsearch/elasticsearch-oss:7.0.0-SNAPSHOT - - docker network inspect elasticsearch > /dev/null || docker network create elasticsearch; - - | - docker run \ - --name es-integration-client \ - --network elasticsearch \ - --env "cluster.name=es-integration-client" \ - --env "discovery.type=single-node" \ - --env "bootstrap.memory_lock=true" \ - --env "cluster.routing.allocation.disk.threshold_enabled=false" \ - --env ES_JAVA_OPTS="-Xms1g -Xmx1g" \ - --volume es-integration-client-data:/usr/share/elasticsearch/data \ - --publish 9200:9200 \ - --ulimit nofile=65536:65536 \ - --ulimit memlock=-1:-1 \ - --detach \ - --rm \ - docker.elastic.co/elasticsearch/elasticsearch-oss:7.0.0-SNAPSHOT - - docker run --network elasticsearch --rm appropriate/curl --max-time 120 --retry 120 --retry-delay 1 --retry-connrefused --show-error --silent http://es-integration-client:9200 - script: - - gotestsum --format=short-verbose --junitfile=/tmp/integration-report.xml -- -race -cover -coverprofile=/tmp/integration-client.cov -tags='integration' -timeout=1h github.com/elastic/go-elasticsearch - after_script: - - test -f /tmp/integration-client.cov && bash <(curl -s https://codecov.io/bash) -f /tmp/integration-client.cov - - - - name: Integration Tests, API | Linux, go:stable - os: linux - go: stable - env: GO111MODULE=on TEST_SUITE=integration-api - before_script: - - docker pull docker.elastic.co/elasticsearch/elasticsearch-oss:7.0.0-SNAPSHOT - - docker network inspect elasticsearch > /dev/null || docker network create elasticsearch; - - | - docker run \ - --name es-integration-api \ - --network elasticsearch \ - --env "cluster.name=es-integration-api" \ - --env "discovery.type=single-node" \ - --env "bootstrap.memory_lock=true" \ - --env "cluster.routing.allocation.disk.threshold_enabled=false" \ - --env "node.attr.testattr=test" \ - --env "path.repo=/tmp" \ - --env "repositories.url.allowed_urls=http://snapshot.test*" \ - --env ES_JAVA_OPTS="-Xms1g -Xmx1g" \ - --volume es-integration-api-data:/usr/share/elasticsearch/data \ - --publish 9200:9200 \ - --ulimit nofile=65536:65536 \ - --ulimit memlock=-1:-1 \ - --detach \ - --rm \ - docker.elastic.co/elasticsearch/elasticsearch-oss:7.0.0-SNAPSHOT - - docker run --network elasticsearch --rm appropriate/curl --max-time 120 --retry 120 --retry-delay 1 --retry-connrefused --show-error --silent http://es-integration-api:9200 - script: - - curl -s http://localhost:9200 | jq -r '.version.build_hash' > .elasticsearch_build_hash && cat .elasticsearch_build_hash - # ------ Download Elasticsearch ----------------------------------------------------------- - - echo -e "\e[33;1mDownload Elasticsearch Git source @ $(cat .elasticsearch_build_hash)\e[0m" && echo -en 'travis_fold:start:script.dl_es_src\\r' - - echo https://github.com/elastic/elasticsearch/archive/$(cat .elasticsearch_build_hash).zip - - | - curl -sSL --retry 3 -o elasticsearch-$(cat .elasticsearch_build_hash).zip https://github.com/elastic/elasticsearch/archive/$(cat .elasticsearch_build_hash).zip && \ - unzip -q -o elasticsearch-$(cat .elasticsearch_build_hash).zip '*.properties' '*.json' '*.yml' -d /tmp && \ - mv /tmp/elasticsearch-$(cat .elasticsearch_build_hash)* /tmp/elasticsearch - - echo -en 'travis_fold:end:script.dl_es_src' - # ------ Generate API registry ------------------------------------------------------------ - - echo -e "\e[33;1mGenerate API registry\e[0m" && echo -en 'travis_fold:start:script.gen_api_reg\\r\n' - - cd ${TRAVIS_HOME}/gopath/src/github.com/elastic/go-elasticsearch/internal/cmd/generate && ELASTICSEARCH_BUILD_HASH=$(cat ../../../.elasticsearch_build_hash) PACKAGE_PATH=${TRAVIS_HOME}/gopath/src/github.com/elastic/go-elasticsearch/esapi go generate -v ./... - - echo -en 'travis_fold:end:script.gen_api_reg' - # ------ Generate Go test files ----------------------------------------------------------- - - echo -e "\e[33;1mGenerate Go test files\e[0m" && echo -en 'travis_fold:start:script.gen_test_files\\r' - - cd ${TRAVIS_HOME}/gopath/src/github.com/elastic/go-elasticsearch/internal/cmd/generate && ELASTICSEARCH_BUILD_HASH=$(cat ../../../.elasticsearch_build_hash) go run main.go apitests --input '/tmp/elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.yml' --output=../../../esapi/test - - echo -en 'travis_fold:end:script.gen_test_files' - # ------ Run tests ----------------------------------------------------------------------- - - cd ${TRAVIS_HOME}/gopath/src/github.com/elastic/go-elasticsearch/esapi/test && time gotestsum --format=short-verbose --junitfile=/tmp/integration-api-report.xml -- -coverpkg=github.com/elastic/go-elasticsearch/esapi -coverprofile=/tmp/integration-api.cov -tags='integration' -timeout=1h ./... - after_script: - - test -f /tmp/integration-api.cov && bash <(curl -s https://codecov.io/bash) -f /tmp/integration-api.cov - -before_install: - - GO111MODULE=off go get -u golang.org/x/lint/golint - - GO111MODULE=off go get -u gotest.tools/gotestsum - -script: echo "TODO > test $TEST_SUITE ($TRAVIS_OS_NAME)" - -notifications: - email: true diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/Dockerfile b/vendor/github.com/elastic/go-elasticsearch/v6/Dockerfile index 312159c61..3b1f51be8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/Dockerfile +++ b/vendor/github.com/elastic/go-elasticsearch/v6/Dockerfile @@ -8,7 +8,7 @@ FROM golang:${VERSION} RUN apk add --no-cache --quiet make curl git jq unzip tree && \ go get -u golang.org/x/lint/golint && \ - curl -sSL --retry 3 --retry-connrefused https://github.com/gotestyourself/gotestsum/releases/download/v0.3.2/gotestsum_0.3.2_linux_amd64.tar.gz | tar -xz -C /usr/local/bin gotestsum + curl -sSL --retry 3 --retry-connrefused https://github.com/gotestyourself/gotestsum/releases/download/v0.4.1/gotestsum_0.4.1_linux_amd64.tar.gz | tar -xz -C /usr/local/bin gotestsum VOLUME ["/tmp"] diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/Makefile b/vendor/github.com/elastic/go-elasticsearch/v6/Makefile index c84712c2e..bdca9c241 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/Makefile +++ b/vendor/github.com/elastic/go-elasticsearch/v6/Makefile @@ -1,6 +1,8 @@ +SHELL := /bin/bash + ##@ Test test-unit: ## Run unit tests - @echo "\033[2m→ Running unit tests...\033[0m" + @printf "\033[2m→ Running unit tests...\033[0m\n" ifdef race $(eval testunitargs += "-race") endif @@ -16,7 +18,7 @@ endif test: test-unit test-integ: ## Run integration tests - @echo "\033[2m→ Running integration tests...\033[0m" + @printf "\033[2m→ Running integration tests...\033[0m\n" $(eval testintegtags += "integration") ifdef multinode $(eval testintegtags += "multinode") @@ -45,9 +47,11 @@ ifdef flavor else $(eval flavor='core') endif - @echo "\033[2m→ Running API integration tests for [$(flavor)]...\033[0m" + @printf "\033[2m→ Running API integration tests for [$(flavor)]...\033[0m\n" ifeq ($(flavor), xpack) @{ \ + set -e ; \ + trap "test -d .git && git checkout --quiet $(PWD)/esapi/test/go.mod" INT TERM EXIT; \ export ELASTICSEARCH_URL='https://elastic:elastic@localhost:9200' && \ if which gotestsum > /dev/null 2>&1 ; then \ cd esapi/test && \ @@ -65,6 +69,8 @@ ifeq ($(flavor), xpack) else $(eval testapiargs += $(PWD)/esapi/test/*_test.go) @{ \ + set -e ; \ + trap "test -d .git && git checkout --quiet $(PWD)/esapi/test/go.mod" INT TERM EXIT; \ if which gotestsum > /dev/null 2>&1 ; then \ cd esapi/test && gotestsum --format=short-verbose --junitfile=$(PWD)/tmp/integration-api-report.xml -- $(testapiargs); \ else \ @@ -75,75 +81,83 @@ else endif test-bench: ## Run benchmarks - @echo "\033[2m→ Running benchmarks...\033[0m" + @printf "\033[2m→ Running benchmarks...\033[0m\n" go test -run=none -bench=. -benchmem ./... test-examples: ## Execute the _examples - @echo "\033[2m→ Testing the examples...\033[0m" + @printf "\033[2m→ Testing the examples...\033[0m\n" @{ \ set -e ; \ + trap "test -d .git && git checkout --quiet _examples/**/go.mod" INT TERM EXIT; \ for f in _examples/*.go; do \ - echo "\033[2m────────────────────────────────────────────────────────────────────────────────"; \ - echo "\033[1m$$f\033[0m"; \ - echo "\033[2m────────────────────────────────────────────────────────────────────────────────\033[0m"; \ + printf "\033[2m────────────────────────────────────────────────────────────────────────────────\n"; \ + printf "\033[1m$$f\033[0m\n"; \ + printf "\033[2m────────────────────────────────────────────────────────────────────────────────\033[0m\n"; \ (go run $$f && true) || \ ( \ - echo "\033[31m────────────────────────────────────────────────────────────────────────────────\033[0m"; \ - echo "\033[31;1m⨯ ERROR\033[0m"; \ + printf "\033[31m────────────────────────────────────────────────────────────────────────────────\033[0m\n"; \ + printf "\033[31;1m⨯ ERROR\033[0m\n"; \ false; \ ); \ done; \ \ for f in _examples/*/; do \ - echo "\033[2m────────────────────────────────────────────────────────────────────────────────\033[0m"; \ - echo "\033[1m$$f\033[0m"; \ - echo "\033[2m────────────────────────────────────────────────────────────────────────────────\033[0m"; \ + printf "\033[2m────────────────────────────────────────────────────────────────────────────────\033[0m\n"; \ + printf "\033[1m$$f\033[0m\n"; \ + printf "\033[2m────────────────────────────────────────────────────────────────────────────────\033[0m\n"; \ (cd $$f && make test && true) || \ ( \ - echo "\033[31m────────────────────────────────────────────────────────────────────────────────\033[0m"; \ - echo "\033[31;1m⨯ ERROR\033[0m"; \ + printf "\033[31m────────────────────────────────────────────────────────────────────────────────\033[0m\n"; \ + printf "\033[31;1m⨯ ERROR\033[0m\n"; \ false; \ ); \ done; \ - echo "\033[32m────────────────────────────────────────────────────────────────────────────────\033[0m"; \ + printf "\033[32m────────────────────────────────────────────────────────────────────────────────\033[0m\n"; \ \ - echo "\033[32;1mSUCCESS\033[0m"; \ + printf "\033[32;1mSUCCESS\033[0m\n"; \ } test-coverage: ## Generate test coverage report - @echo "\033[2m→ Generating test coverage report...\033[0m" + @printf "\033[2m→ Generating test coverage report...\033[0m\n" @go tool cover -html=tmp/unit.cov -o tmp/coverage.html @go tool cover -func=tmp/unit.cov | 'grep' -v 'esapi/api\.' | sed 's/github.com\/elastic\/go-elasticsearch\///g' - @echo "--------------------------------------------------------------------------------\nopen tmp/coverage.html\n" + @printf "\033[0m--------------------------------------------------------------------------------\nopen tmp/coverage.html\n\n\033[0m" ##@ Development lint: ## Run lint on the package - @echo "\033[2m→ Running lint...\033[0m" + @printf "\033[2m→ Running lint...\033[0m\n" go vet github.com/elastic/go-elasticsearch/... go list github.com/elastic/go-elasticsearch/... | 'grep' -v internal | xargs golint -set_exit_status + @{ \ + set -e ; \ + trap "test -d ../../../.git && git checkout --quiet go.mod" INT TERM EXIT; \ + echo "cd internal/cmd/generate/ && go vet ./..."; \ + cd "internal/cmd/generate/" && go vet ./...; \ + } + apidiff: ## Display API incompabilities @if ! command -v apidiff > /dev/null; then \ - echo "\033[31;1mERROR: apidiff not installed\033[0m"; \ - echo "go get -u github.com/go-modules-by-example/apidiff"; \ - echo "\033[2m→ https://github.com/go-modules-by-example/index/blob/master/019_apidiff/README.md\033[0m\n"; \ + printf "\033[31;1mERROR: apidiff not installed\033[0m\n"; \ + printf "go get -u github.com/go-modules-by-example/apidiff\n"; \ + printf "\033[2m→ https://github.com/go-modules-by-example/index/blob/master/019_apidiff/README.md\033[0m\n\n"; \ false; \ fi; @rm -rf tmp/apidiff-OLD tmp/apidiff-NEW @git clone --quiet --local .git/ tmp/apidiff-OLD @mkdir -p tmp/apidiff-NEW @tar -c --exclude .git --exclude tmp --exclude cmd . | tar -x -C tmp/apidiff-NEW - @echo "\033[2m→ Running apidiff...\033[0m" - @echo "tmp/apidiff-OLD/esapi tmp/apidiff-NEW/esapi" + @printf "\033[2m→ Running apidiff...\033[0m\n" + @pritnf "tmp/apidiff-OLD/esapi tmp/apidiff-NEW/esapi\n" @{ \ set -e ; \ output=$$(apidiff tmp/apidiff-OLD/esapi tmp/apidiff-NEW/esapi); \ - echo "\n$$output\n"; \ + printf "\n$$output\n\n"; \ if echo $$output | grep -i -e 'incompatible' - > /dev/null 2>&1; then \ - echo "\n\033[31;1mFAILURE\033[0m\n"; \ + printf "\n\033[31;1mFAILURE\033[0m\n\n"; \ false; \ else \ - echo "\033[32;1mSUCCESS\033[0m"; \ + printf "\033[32;1mSUCCESS\033[0m\n"; \ fi; \ } @@ -158,7 +172,7 @@ else $(eval branches_list = $(shell echo $(branches) | tr ',' ' ') ) endif $(eval commits_list = $(shell echo $(commits) | tr ',' ' ')) - @echo "\033[2m→ Backporting commits [$(commits)]\033[0m" + @printf "\033[2m→ Backporting commits [$(commits)]\033[0m\n" @{ \ set -e -o pipefail; \ for commit in $(commits_list); do \ @@ -166,7 +180,7 @@ endif done; \ echo ""; \ for branch in $(branches_list); do \ - echo "\033[2m→ $$branch\033[0m"; \ + printf "\033[2m→ $$branch\033[0m\n"; \ git checkout $$branch; \ for commit in $(commits_list); do \ git cherry-pick -x $$commit; \ @@ -174,68 +188,80 @@ endif git status --short --branch; \ echo ""; \ done; \ - echo "\033[2m→ Push updates to Github:\033[0m"; \ + printf "\033[2m→ Push updates to Github:\033[0m\n"; \ for branch in $(branches_list); do \ echo "git push --verbose origin $$branch"; \ done; \ } release: ## Release a new version to Github + $(eval branch = $(shell git rev-parse --abbrev-ref HEAD)) + $(eval current_version = $(shell cat internal/version/version.go | sed -Ee 's/const Client = "(.*)"/\1/' | tail -1)) + @printf "\033[2m→ [$(branch)] Current version: $(current_version)...\033[0m\n" ifndef version - @echo "Missing version argument, exiting..." + @printf "\033[31m[!] Missing version argument, exiting...\033[0m\n" @exit 2 endif ifeq ($(version), "") - @echo "Empty version argument, exiting..." + @printf "\033[31m[!] Empty version argument, exiting...\033[0m\n" @exit 2 endif - @echo "\033[2m→ Creating version $(version)...\033[0m" + @printf "\033[2m→ [$(branch)] Creating version $(version)...\033[0m\n" @{ \ + set -e -o pipefail; \ cp internal/version/version.go internal/version/version.go.OLD && \ cat internal/version/version.go.OLD | sed -e 's/Client = ".*"/Client = "$(version)"/' > internal/version/version.go && \ - rm internal/version/version.go.OLD && \ go vet internal/version/version.go && \ go fmt internal/version/version.go && \ git diff --color-words internal/version/version.go | tail -n 1; \ } @{ \ - echo "\033[2m→ Commit and create Git tag? (y/n): \033[0m\c"; \ + set -e -o pipefail; \ + printf "\033[2m→ Commit and create Git tag? (y/n): \033[0m\c"; \ read continue; \ if [[ $$continue == "y" ]]; then \ git add internal/version/version.go && \ git commit --no-status --quiet --message "Release $(version)" && \ git tag --annotate v$(version) --message 'Release $(version)'; \ - echo "\033[2m→ Push `git show --pretty='%h (%s)' --no-patch HEAD` to Github:\033[0m\n"; \ - echo "\033[1m git push origin v$(version)\033[0m\n"; \ + printf "\033[2m→ Push `git show --pretty='%h (%s)' --no-patch HEAD` to Github:\033[0m\n\n"; \ + printf "\033[1m git push origin HEAD && git push origin v$(version)\033[0m\n\n"; \ + mv internal/version/version.go.OLD internal/version/version.go && \ + git add internal/version/version.go && \ + original_version=`cat internal/version/version.go | sed -ne 's;^const Client = "\(.*\)"$$;\1;p'` && \ + git commit --no-status --quiet --message "Update version to $$original_version"; \ + printf "\033[2m→ Version updated to [$$original_version].\033[0m\n\n"; \ else \ echo "Aborting..."; \ + rm internal/version/version.go.OLD; \ exit 1; \ fi; \ } godoc: ## Display documentation for the package - @echo "\033[2m→ Generating documentation...\033[0m" - @echo "open http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/\n" - mkdir -p /tmp/tmpgoroot/doc - rm -rf /tmp/tmpgopath/src/github.com/elastic/go-elasticsearch - mkdir -p /tmp/tmpgopath/src/github.com/elastic/go-elasticsearch - tar -c --exclude='.git' --exclude='tmp' . | tar -x -C /tmp/tmpgopath/src/github.com/elastic/go-elasticsearch - GOROOT=/tmp/tmpgoroot/ GOPATH=/tmp/tmpgopath/ godoc -http=localhost:6060 -play + @printf "\033[2m→ Generating documentation...\033[0m\n" + @echo "* http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/v6" + @echo "* http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/v6/esapi" + @echo "* http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/v6/estransport" + @echo "* http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/v6/esutil" + @printf "\n" + godoc --http=localhost:6060 --play cluster: ## Launch an Elasticsearch cluster with Docker $(eval version ?= "elasticsearch-oss:6.8-SNAPSHOT") ifeq ($(origin nodes), undefined) $(eval nodes = 1) endif - @echo "\033[2m→ Launching" $(nodes) "node(s) of" $(version) "...\033[0m" + @printf "\033[2m→ Launching %d node(s) of %s...\033[0m\n" $(nodes) $(version) ifeq ($(shell test $(nodes) && test $(nodes) -gt 1; echo $$?),0) - $(eval detached ?= "true") + $(eval detach ?= "true") else - $(eval detached ?= "false") + $(eval detach ?= "false") endif ifdef version ifneq (,$(findstring oss,$(version))) + $(eval elasticsearch_url = "http://es1:9200") else + $(eval elasticsearch_url = "https://elastic:elastic@es1:9200") $(eval xpack_env += --env "ELASTIC_PASSWORD=elastic") $(eval xpack_env += --env "xpack.license.self_generated.type=trial") $(eval xpack_env += --env "xpack.security.enabled=true") @@ -244,10 +270,12 @@ else $(eval xpack_env += --env "xpack.security.http.ssl.key=certs/testnode.key") $(eval xpack_env += --env "xpack.security.http.ssl.certificate=certs/testnode.crt") $(eval xpack_env += --env "xpack.security.http.ssl.certificate_authorities=certs/ca.crt") + $(eval xpack_env += --env "xpack.security.http.ssl.verification_mode=none") $(eval xpack_env += --env "xpack.security.transport.ssl.enabled=true") $(eval xpack_env += --env "xpack.security.transport.ssl.key=certs/testnode.key") $(eval xpack_env += --env "xpack.security.transport.ssl.certificate=certs/testnode.crt") $(eval xpack_env += --env "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt") + $(eval xpack_env += --env "xpack.security.transport.ssl.verification_mode=none") $(eval xpack_volumes += --volume "$(PWD)/.jenkins/certs/testnode.crt:/usr/share/elasticsearch/config/certs/testnode.crt") $(eval xpack_volumes += --volume "$(PWD)/.jenkins/certs/testnode.key:/usr/share/elasticsearch/config/certs/testnode.key") $(eval xpack_volumes += --volume "$(PWD)/.jenkins/certs/ca.crt:/usr/share/elasticsearch/config/certs/ca.crt") @@ -279,31 +307,31 @@ endif --publish $$hostport:9200 \ --ulimit nofile=65536:65536 \ --ulimit memlock=-1:-1 \ - --detach=$(detached) \ + --detach=$(detach) \ --rm \ docker.elastic.co/elasticsearch/$(version); \ done \ } -ifdef detached +ifdef detach @{ \ - echo "\033[2m→ Waiting for the cluster...\033[0m"; \ - docker run --network elasticsearch --rm appropriate/curl --max-time 120 --retry 120 --retry-delay 1 --retry-connrefused --show-error --silent http://es1:9200; \ + printf "\033[2m→ Waiting for the cluster on $(elasticsearch_url)...\033[0m\n"; \ + docker run --network elasticsearch --rm appropriate/curl --max-time 120 --retry 120 --retry-delay 1 --retry-connrefused --show-error --silent --insecure $(elasticsearch_url); \ output="\033[2m→ Cluster ready; to remove containers:"; \ output="$$output docker rm -f"; \ for n in `seq 1 $(nodes)`; do \ output="$$output es$$n"; \ done; \ - echo "$$output\033[0m"; \ + printf "$$output\033[0m\n"; \ } endif cluster-update: ## Update the Docker image $(eval version ?= "elasticsearch-oss:6.8-SNAPSHOT") - @echo "\033[2m→ Updating the Docker image...\033[0m" + @printf "\033[2m→ Updating the Docker image...\033[0m\n" @docker pull docker.elastic.co/elasticsearch/$(version); cluster-clean: ## Remove unused Docker volumes and networks - @echo "\033[2m→ Cleaning up Docker assets...\033[0m" + @printf "\033[2m→ Cleaning up Docker assets...\033[0m\n" docker volume prune --force docker network prune --force @@ -318,8 +346,8 @@ gen-api: ## Generate the API package from the JSON specification ifdef debug $(eval args += --debug) endif -ifdef ELASTICSEARCH_VERSION - $(eval version = $(ELASTICSEARCH_VERSION)) +ifdef ELASTICSEARCH_BUILD_VERSION + $(eval version = $(ELASTICSEARCH_BUILD_VERSION)) else $(eval version = $(shell cat "$(input)/buildSrc/version.properties" | grep 'elasticsearch' | cut -d '=' -f 2 | tr -d ' ')) endif @@ -328,9 +356,11 @@ ifdef ELASTICSEARCH_BUILD_HASH else $(eval build_hash = $(shell git --git-dir='$(input)/.git' rev-parse --short HEAD)) endif - @echo "\033[2m→ Generating API package from specification ($(version):$(build_hash))...\033[0m" + @printf "\033[2m→ Generating API package from specification ($(version):$(build_hash))...\033[0m\n" @{ \ - export ELASTICSEARCH_VERSION=$(version) && \ + set -e; \ + trap "test -d .git && git checkout --quiet $(PWD)/internal/cmd/generate/go.mod" INT TERM EXIT; \ + export ELASTICSEARCH_BUILD_VERSION=$(version) && \ export ELASTICSEARCH_BUILD_HASH=$(build_hash) && \ cd internal/cmd/generate && \ go run main.go apisource --input '$(PWD)/$(input)/rest-api-spec/src/main/resources/rest-api-spec/api/*.json' --output '$(PWD)/$(output)' $(args) && \ @@ -344,8 +374,8 @@ gen-tests: ## Generate the API tests from the YAML specification ifdef debug $(eval args += --debug) endif -ifdef ELASTICSEARCH_VERSION - $(eval version = $(ELASTICSEARCH_VERSION)) +ifdef ELASTICSEARCH_BUILD_VERSION + $(eval version = $(ELASTICSEARCH_BUILD_VERSION)) else $(eval version = $(shell cat "$(input)/buildSrc/version.properties" | grep 'elasticsearch' | cut -d '=' -f 2 | tr -d ' ')) endif @@ -354,13 +384,16 @@ ifdef ELASTICSEARCH_BUILD_HASH else $(eval build_hash = $(shell git --git-dir='$(input)/.git' rev-parse --short HEAD)) endif - @echo "\033[2m→ Generating API tests from specification ($(version):$(build_hash))...\033[0m" + @printf "\033[2m→ Generating API tests from specification ($(version):$(build_hash))...\033[0m\n" @{ \ - export ELASTICSEARCH_VERSION=$(version) && \ + set -e; \ + trap "test -d .git && git checkout --quiet $(PWD)/internal/cmd/generate/go.mod" INT TERM EXIT; \ + export ELASTICSEARCH_BUILD_VERSION=$(version) && \ export ELASTICSEARCH_BUILD_HASH=$(build_hash) && \ rm -rf $(output)/*_test.go && \ rm -rf $(output)/xpack && \ cd internal/cmd/generate && \ + go get golang.org/x/tools/cmd/goimports && \ go generate ./... && \ go run main.go apitests --input '$(PWD)/$(input)/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.y*ml' --output '$(PWD)/$(output)' $(args) && \ go run main.go apitests --input '$(PWD)/$(input)/x-pack/plugin/src/test/resources/rest-api-spec/test/**/*.yml' --output '$(PWD)/$(output)/xpack' $(args) && \ diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/README.md b/vendor/github.com/elastic/go-elasticsearch/v6/README.md index b4b33a54d..c7d921801 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/README.md +++ b/vendor/github.com/elastic/go-elasticsearch/v6/README.md @@ -2,10 +2,13 @@ The official Go client for [Elasticsearch](https://www.elastic.co/products/elasticsearch). -[![GoDoc](https://godoc.org/github.com/elastic/go-elasticsearch?status.svg)](http://godoc.org/github.com/elastic/go-elasticsearch) -[![Travis-CI](https://travis-ci.org/elastic/go-elasticsearch.svg?branch=master)](https://travis-ci.org/elastic/go-elasticsearch) +[![GoDoc](https://godoc.org/github.com/elastic/go-elasticsearch?status.svg)](https://pkg.go.dev/github.com/elastic/go-elasticsearch/v6) [![Go Report Card](https://goreportcard.com/badge/github.com/elastic/go-elasticsearch)](https://goreportcard.com/report/github.com/elastic/go-elasticsearch) [![codecov.io](https://codecov.io/github/elastic/go-elasticsearch/coverage.svg?branch=master)](https://codecov.io/gh/elastic/go-elasticsearch?branch=master) +[![Build](https://github.com/elastic/go-elasticsearch/workflows/Build/badge.svg)](https://github.com/elastic/go-elasticsearch/actions?query=branch%3A6.x) +[![Unit](https://github.com/elastic/go-elasticsearch/workflows/Unit/badge.svg)](https://github.com/elastic/go-elasticsearch/actions?query=branch%3A6.x) +[![Integration](https://github.com/elastic/go-elasticsearch/workflows/Integration/badge.svg)](https://github.com/elastic/go-elasticsearch/actions?query=branch%3A6.x) +[![API](https://github.com/elastic/go-elasticsearch/workflows/API/badge.svg)](https://github.com/elastic/go-elasticsearch/actions?query=branch%3A6.x) ## Compatibility @@ -106,7 +109,7 @@ log.Println(res) When you export the `ELASTICSEARCH_URL` environment variable, it will be used to set the cluster endpoint(s). Separate multiple adresses by a comma. -To set the cluster endpoint(s) programatically, pass them in the configuration object +To set the cluster endpoint(s) programatically, pass a configuration object to the `elasticsearch.NewClient()` function. ```golang @@ -115,34 +118,55 @@ cfg := elasticsearch.Config{ "http://localhost:9200", "http://localhost:9201", }, + // ... } es, err := elasticsearch.NewClient(cfg) -// ... ``` -To configure the HTTP settings, pass a [`http.Transport`](https://golang.org/pkg/net/http/#Transport) -object in the configuration object (the values are for illustrative purposes only). +To set the username and password, include them in the endpoint URL, +or use the corresponding configuration options. + +```golang +cfg := elasticsearch.Config{ + // ... + Username: "foo", + Password: "bar", +} +``` + +To set a custom certificate authority used to sign the certificates of cluster nodes, +use the `CACert` configuration option. + +```golang +cert, _ := ioutil.ReadFile(*cacert) + +cfg := elasticsearch.Config{ + // ... + CACert: cert, +} +``` + +To configure other HTTP settings, pass an [`http.Transport`](https://golang.org/pkg/net/http/#Transport) +object in the configuration object. ```golang cfg := elasticsearch.Config{ Transport: &http.Transport{ MaxIdleConnsPerHost: 10, ResponseHeaderTimeout: time.Second, - DialContext: (&net.Dialer{Timeout: time.Second}).DialContext, TLSClientConfig: &tls.Config{ MinVersion: tls.VersionTLS11, // ... }, + // ... }, } - -es, err := elasticsearch.NewClient(cfg) -// ... ``` See the [`_examples/configuration.go`](_examples/configuration.go) and [`_examples/customization.go`](_examples/customization.go) files for more examples of configuration and customization of the client. +See the [`_examples/security`](_examples/security) for an example of a security configuration. The following example demonstrates a more complex usage. It fetches the Elasticsearch version from the cluster, indexes a couple of documents concurrently, and prints the search results, using a lightweight wrapper around the response body. @@ -187,6 +211,7 @@ func main() { if err != nil { log.Fatalf("Error getting response: %s", err) } + defer res.Body.Close() // Check response status if res.IsError() { log.Fatalf("Error: %s", res.String()) @@ -335,7 +360,7 @@ The `esutil` package provides convenience helpers for working with the client. A ## Examples -The **[`_examples`](./_examples)** folder contains a number of recipes and comprehensive examples to get you started with the client, including configuration and customization of the client, mocking the transport for unit tests, embedding the client in a custom type, building queries, performing requests, and parsing the responses. +The **[`_examples`](./_examples)** folder contains a number of recipes and comprehensive examples to get you started with the client, including configuration and customization of the client, using a custom certificate authority (CA) for security (TLS), mocking the transport for unit tests, embedding the client in a custom type, building queries, performing requests individually and in bulk, and parsing the responses. diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/doc.go b/vendor/github.com/elastic/go-elasticsearch/v6/doc.go index dd1ce8360..a60225533 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/doc.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/doc.go @@ -29,6 +29,9 @@ To configure the client, pass a Config object to the NewClient function: elasticsearch.NewClient(cfg) +When using the Elastic Service (https://elastic.co/cloud), you can use CloudID instead of Addresses. +When either Addresses or CloudID is set, the ELASTICSEARCH_URL environment variable is ignored. + See the elasticsearch_integration_test.go file and the _examples folder for more information. Call the Elasticsearch APIs by invoking the corresponding methods on the client: @@ -40,6 +43,8 @@ Call the Elasticsearch APIs by invoking the corresponding methods on the client: log.Println(res) -See the github.com/elastic/go-elasticsearch/esapi package for more information and examples. +See the github.com/elastic/go-elasticsearch/esapi package for more information about using the API. + +See the github.com/elastic/go-elasticsearch/estransport package for more information about configuring the transport. */ package elasticsearch diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/elasticsearch.go b/vendor/github.com/elastic/go-elasticsearch/v6/elasticsearch.go index 06ee008b4..7cd74b7e6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/elasticsearch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/elasticsearch.go @@ -1,12 +1,18 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package elasticsearch import ( + "encoding/base64" "errors" "fmt" "net/http" "net/url" "os" "strings" + "time" "github.com/elastic/go-elasticsearch/v6/esapi" "github.com/elastic/go-elasticsearch/v6/estransport" @@ -28,8 +34,35 @@ type Config struct { Username string // Username for HTTP Basic Authentication. Password string // Password for HTTP Basic Authentication. - Transport http.RoundTripper // The HTTP transport object. - Logger estransport.Logger // The logger object. + CloudID string // Endpoint for the Elastic Service (https://elastic.co/cloud). + APIKey string // Base64-encoded token for authorization; if set, overrides username and password. + + Header http.Header // Global HTTP request header. + + // PEM-encoded certificate authorities. + // When set, an empty certificate pool will be created, and the certificates will be appended to it. + // The option is only valid when the transport is not specified, or when it's http.Transport. + CACert []byte + + RetryOnStatus []int // List of status codes for retry. Default: 502, 503, 504. + DisableRetry bool // Default: false. + EnableRetryOnTimeout bool // Default: false. + MaxRetries int // Default: 3. + + DiscoverNodesOnStart bool // Discover nodes when initializing the client. Default: false. + DiscoverNodesInterval time.Duration // Discover nodes periodically. Default: disabled. + + EnableMetrics bool // Enable the metrics collection. + EnableDebugLogger bool // Enable the debug logging. + + RetryBackoff func(attempt int) time.Duration // Optional backoff duration. Default: nil. + + Transport http.RoundTripper // The HTTP transport object. + Logger estransport.Logger // The logger object. + Selector estransport.Selector // The selector object. + + // Optional constructor function for a custom ConnectionPool. Default: nil. + ConnectionPoolFunc func([]*estransport.Connection, estransport.Selector) estransport.ConnectionPool } // Client represents the Elasticsearch client. @@ -57,17 +90,33 @@ func NewDefaultClient() (*Client, error) { // It will use the ELASTICSEARCH_URL environment variable, if set, // to configure the addresses; use a comma to separate multiple URLs. // -// It's an error to set both cfg.Addresses and the ELASTICSEARCH_URL -// environment variable. +// If either cfg.Addresses or cfg.CloudID is set, the ELASTICSEARCH_URL +// environment variable is ignored. +// +// It's an error to set both cfg.Addresses and cfg.CloudID. // func NewClient(cfg Config) (*Client, error) { - envAddrs := addrsFromEnvironment() + var addrs []string - if len(envAddrs) > 0 && len(cfg.Addresses) > 0 { - return nil, errors.New("cannot create client: both ELASTICSEARCH_URL and Addresses are set") - } + if len(cfg.Addresses) == 0 && cfg.CloudID == "" { + addrs = addrsFromEnvironment() + } else { + if len(cfg.Addresses) > 0 && cfg.CloudID != "" { + return nil, errors.New("cannot create client: both Addresses and CloudID are set") + } + + if cfg.CloudID != "" { + cloudAddr, err := addrFromCloudID(cfg.CloudID) + if err != nil { + return nil, fmt.Errorf("cannot create client: cannot parse CloudID: %s", err) + } + addrs = append(addrs, cloudAddr) + } - addrs := append(envAddrs, cfg.Addresses...) + if len(cfg.Addresses) > 0 { + addrs = append(addrs, cfg.Addresses...) + } + } urls, err := addrsToURLs(addrs) if err != nil { @@ -79,16 +128,49 @@ func NewClient(cfg Config) (*Client, error) { urls = append(urls, u) } - tp := estransport.New(estransport.Config{ + // TODO(karmi): Refactor + if urls[0].User != nil { + cfg.Username = urls[0].User.Username() + pw, _ := urls[0].User.Password() + cfg.Password = pw + } + + tp, err := estransport.New(estransport.Config{ URLs: urls, Username: cfg.Username, Password: cfg.Password, + APIKey: cfg.APIKey, + + Header: cfg.Header, + CACert: cfg.CACert, + + RetryOnStatus: cfg.RetryOnStatus, + DisableRetry: cfg.DisableRetry, + EnableRetryOnTimeout: cfg.EnableRetryOnTimeout, + MaxRetries: cfg.MaxRetries, + RetryBackoff: cfg.RetryBackoff, + + EnableMetrics: cfg.EnableMetrics, + EnableDebugLogger: cfg.EnableDebugLogger, + + DiscoverNodesInterval: cfg.DiscoverNodesInterval, - Transport: cfg.Transport, - Logger: cfg.Logger, + Transport: cfg.Transport, + Logger: cfg.Logger, + Selector: cfg.Selector, + ConnectionPoolFunc: cfg.ConnectionPoolFunc, }) + if err != nil { + return nil, fmt.Errorf("error creating transport: %s", err) + } + + client := &Client{Transport: tp, API: esapi.New(tp)} - return &Client{Transport: tp, API: esapi.New(tp)}, nil + if cfg.DiscoverNodesOnStart { + go client.DiscoverNodes() + } + + return client, nil } // Perform delegates to Transport to execute a request and return a response. @@ -97,6 +179,24 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { return c.Transport.Perform(req) } +// Metrics returns the client metrics. +// +func (c *Client) Metrics() (estransport.Metrics, error) { + if mt, ok := c.Transport.(estransport.Measurable); ok { + return mt.Metrics() + } + return estransport.Metrics{}, errors.New("transport is missing method Metrics()") +} + +// DiscoverNodes reloads the client connections by fetching information from the cluster. +// +func (c *Client) DiscoverNodes() error { + if dt, ok := c.Transport.(estransport.Discoverable); ok { + return dt.DiscoverNodes() + } + return errors.New("transport is missing method DiscoverNodes()") +} + // addrsFromEnvironment returns a list of addresses by splitting // the ELASTICSEARCH_URL environment variable with comma, or an empty list. // @@ -127,3 +227,26 @@ func addrsToURLs(addrs []string) ([]*url.URL, error) { } return urls, nil } + +// addrFromCloudID extracts the Elasticsearch URL from CloudID. +// See: https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html +// +func addrFromCloudID(input string) (string, error) { + var scheme = "https://" + + values := strings.Split(input, ":") + if len(values) != 2 { + return "", fmt.Errorf("unexpected format: %q", input) + } + data, err := base64.StdEncoding.DecodeString(values[1]) + if err != nil { + return "", err + } + parts := strings.Split(string(data), "$") + + if len(parts) < 2 { + return "", fmt.Errorf("invalid encoded value: %s", parts) + } + + return fmt.Sprintf("%s%s.%s", scheme, parts[1], parts[0]), nil +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api._.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api._.go index 55aa154b0..7f2c52900 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api._.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api._.go @@ -1,4 +1,4 @@ -// Code generated from specification version 6.8.2-SNAPSHOT (8aa0ff06c9d): DO NOT EDIT +// Code generated from specification version 6.8.8 (2f4c2240ecf): DO NOT EDIT package esapi @@ -217,41 +217,143 @@ type ILM struct { // License contains the License APIs type License struct { + Delete XPackLicenseDelete + GetBasicStatus XPackLicenseGetBasicStatus + Get XPackLicenseGet + GetTrialStatus XPackLicenseGetTrialStatus + Post XPackLicensePost + PostStartBasic XPackLicensePostStartBasic + PostStartTrial XPackLicensePostStartTrial } // Migration contains the Migration APIs type Migration struct { + Deprecations XPackMigrationDeprecations + GetAssistance XPackMigrationGetAssistance + Upgrade XPackMigrationUpgrade } // ML contains the ML APIs type ML struct { + CloseJob XPackMLCloseJob + DeleteCalendarEvent XPackMLDeleteCalendarEvent + DeleteCalendarJob XPackMLDeleteCalendarJob + DeleteCalendar XPackMLDeleteCalendar + DeleteDatafeed XPackMLDeleteDatafeed + DeleteExpiredData XPackMLDeleteExpiredData + DeleteFilter XPackMLDeleteFilter + DeleteForecast XPackMLDeleteForecast + DeleteJob XPackMLDeleteJob + DeleteModelSnapshot XPackMLDeleteModelSnapshot + FindFileStructure XPackMLFindFileStructure + FlushJob XPackMLFlushJob + Forecast XPackMLForecast + GetBuckets XPackMLGetBuckets + GetCalendarEvents XPackMLGetCalendarEvents + GetCalendars XPackMLGetCalendars + GetCategories XPackMLGetCategories + GetDatafeedStats XPackMLGetDatafeedStats + GetDatafeeds XPackMLGetDatafeeds + GetFilters XPackMLGetFilters + GetInfluencers XPackMLGetInfluencers + GetJobStats XPackMLGetJobStats + GetJobs XPackMLGetJobs + GetModelSnapshots XPackMLGetModelSnapshots + GetOverallBuckets XPackMLGetOverallBuckets + GetRecords XPackMLGetRecords + Info XPackMLInfo + OpenJob XPackMLOpenJob + PostCalendarEvents XPackMLPostCalendarEvents + PostData XPackMLPostData + PreviewDatafeed XPackMLPreviewDatafeed + PutCalendarJob XPackMLPutCalendarJob + PutCalendar XPackMLPutCalendar + PutDatafeed XPackMLPutDatafeed + PutFilter XPackMLPutFilter + PutJob XPackMLPutJob + RevertModelSnapshot XPackMLRevertModelSnapshot + SetUpgradeMode XPackMLSetUpgradeMode + StartDatafeed XPackMLStartDatafeed + StopDatafeed XPackMLStopDatafeed + UpdateDatafeed XPackMLUpdateDatafeed + UpdateFilter XPackMLUpdateFilter + UpdateJob XPackMLUpdateJob + UpdateModelSnapshot XPackMLUpdateModelSnapshot + ValidateDetector XPackMLValidateDetector + Validate XPackMLValidate } // Monitoring contains the Monitoring APIs type Monitoring struct { + Bulk XPackMonitoringBulk } // Rollup contains the Rollup APIs type Rollup struct { + DeleteJob XPackRollupDeleteJob + GetJobs XPackRollupGetJobs + GetCaps XPackRollupGetRollupCaps + GetIndexCaps XPackRollupGetRollupIndexCaps + PutJob XPackRollupPutJob + Search XPackRollupRollupSearch + StartJob XPackRollupStartJob + StopJob XPackRollupStopJob } // Security contains the Security APIs type Security struct { - CreateAPIKey SecurityCreateAPIKey - GetAPIKey SecurityGetAPIKey - InvalidateAPIKey SecurityInvalidateAPIKey + CreateAPIKey SecurityCreateAPIKey + GetAPIKey SecurityGetAPIKey + InvalidateAPIKey SecurityInvalidateAPIKey + Authenticate XPackSecurityAuthenticate + ChangePassword XPackSecurityChangePassword + ClearCachedRealms XPackSecurityClearCachedRealms + ClearCachedRoles XPackSecurityClearCachedRoles + DeletePrivileges XPackSecurityDeletePrivileges + DeleteRoleMapping XPackSecurityDeleteRoleMapping + DeleteRole XPackSecurityDeleteRole + DeleteUser XPackSecurityDeleteUser + DisableUser XPackSecurityDisableUser + EnableUser XPackSecurityEnableUser + GetPrivileges XPackSecurityGetPrivileges + GetRoleMapping XPackSecurityGetRoleMapping + GetRole XPackSecurityGetRole + GetToken XPackSecurityGetToken + GetUserPrivileges XPackSecurityGetUserPrivileges + GetUser XPackSecurityGetUser + HasPrivileges XPackSecurityHasPrivileges + InvalidateToken XPackSecurityInvalidateToken + PutPrivileges XPackSecurityPutPrivileges + PutRoleMapping XPackSecurityPutRoleMapping + PutRole XPackSecurityPutRole + PutUser XPackSecurityPutUser } // SQL contains the SQL APIs type SQL struct { + ClearCursor XPackSQLClearCursor + Query XPackSQLQuery + Translate XPackSQLTranslate } // SSL contains the SSL APIs type SSL struct { + Certificates XPackSSLCertificates } // Watcher contains the Watcher APIs type Watcher struct { + AckWatch XPackWatcherAckWatch + ActivateWatch XPackWatcherActivateWatch + DeactivateWatch XPackWatcherDeactivateWatch + DeleteWatch XPackWatcherDeleteWatch + ExecuteWatch XPackWatcherExecuteWatch + GetWatch XPackWatcherGetWatch + PutWatch XPackWatcherPutWatch + Restart XPackWatcherRestart + Start XPackWatcherStart + Stats XPackWatcherStats + Stop XPackWatcherStop } // XPack contains the XPack APIs @@ -361,6 +463,18 @@ type XPack struct { WatcherStart XPackWatcherStart WatcherStats XPackWatcherStats WatcherStop XPackWatcherStop + CCR *CCR + ILM *ILM + License *License + Migration *Migration + ML *ML + Monitoring *Monitoring + Rollup *Rollup + Security *Security + SQL *SQL + SSL *SSL + Watcher *Watcher + XPack *XPack } // New creates new API @@ -652,6 +766,130 @@ func New(t Transport) *API { WatcherStart: newXPackWatcherStartFunc(t), WatcherStats: newXPackWatcherStatsFunc(t), WatcherStop: newXPackWatcherStopFunc(t), + // Update the XPack struct + CCR: &CCR{}, + ILM: &ILM{}, + License: &License{ + Delete: newXPackLicenseDeleteFunc(t), + GetBasicStatus: newXPackLicenseGetBasicStatusFunc(t), + Get: newXPackLicenseGetFunc(t), + GetTrialStatus: newXPackLicenseGetTrialStatusFunc(t), + Post: newXPackLicensePostFunc(t), + PostStartBasic: newXPackLicensePostStartBasicFunc(t), + PostStartTrial: newXPackLicensePostStartTrialFunc(t), + }, + Migration: &Migration{ + Deprecations: newXPackMigrationDeprecationsFunc(t), + GetAssistance: newXPackMigrationGetAssistanceFunc(t), + Upgrade: newXPackMigrationUpgradeFunc(t), + }, + ML: &ML{ + CloseJob: newXPackMLCloseJobFunc(t), + DeleteCalendarEvent: newXPackMLDeleteCalendarEventFunc(t), + DeleteCalendarJob: newXPackMLDeleteCalendarJobFunc(t), + DeleteCalendar: newXPackMLDeleteCalendarFunc(t), + DeleteDatafeed: newXPackMLDeleteDatafeedFunc(t), + DeleteExpiredData: newXPackMLDeleteExpiredDataFunc(t), + DeleteFilter: newXPackMLDeleteFilterFunc(t), + DeleteForecast: newXPackMLDeleteForecastFunc(t), + DeleteJob: newXPackMLDeleteJobFunc(t), + DeleteModelSnapshot: newXPackMLDeleteModelSnapshotFunc(t), + FindFileStructure: newXPackMLFindFileStructureFunc(t), + FlushJob: newXPackMLFlushJobFunc(t), + Forecast: newXPackMLForecastFunc(t), + GetBuckets: newXPackMLGetBucketsFunc(t), + GetCalendarEvents: newXPackMLGetCalendarEventsFunc(t), + GetCalendars: newXPackMLGetCalendarsFunc(t), + GetCategories: newXPackMLGetCategoriesFunc(t), + GetDatafeedStats: newXPackMLGetDatafeedStatsFunc(t), + GetDatafeeds: newXPackMLGetDatafeedsFunc(t), + GetFilters: newXPackMLGetFiltersFunc(t), + GetInfluencers: newXPackMLGetInfluencersFunc(t), + GetJobStats: newXPackMLGetJobStatsFunc(t), + GetJobs: newXPackMLGetJobsFunc(t), + GetModelSnapshots: newXPackMLGetModelSnapshotsFunc(t), + GetOverallBuckets: newXPackMLGetOverallBucketsFunc(t), + GetRecords: newXPackMLGetRecordsFunc(t), + Info: newXPackMLInfoFunc(t), + OpenJob: newXPackMLOpenJobFunc(t), + PostCalendarEvents: newXPackMLPostCalendarEventsFunc(t), + PostData: newXPackMLPostDataFunc(t), + PreviewDatafeed: newXPackMLPreviewDatafeedFunc(t), + PutCalendarJob: newXPackMLPutCalendarJobFunc(t), + PutCalendar: newXPackMLPutCalendarFunc(t), + PutDatafeed: newXPackMLPutDatafeedFunc(t), + PutFilter: newXPackMLPutFilterFunc(t), + PutJob: newXPackMLPutJobFunc(t), + RevertModelSnapshot: newXPackMLRevertModelSnapshotFunc(t), + SetUpgradeMode: newXPackMLSetUpgradeModeFunc(t), + StartDatafeed: newXPackMLStartDatafeedFunc(t), + StopDatafeed: newXPackMLStopDatafeedFunc(t), + UpdateDatafeed: newXPackMLUpdateDatafeedFunc(t), + UpdateFilter: newXPackMLUpdateFilterFunc(t), + UpdateJob: newXPackMLUpdateJobFunc(t), + UpdateModelSnapshot: newXPackMLUpdateModelSnapshotFunc(t), + ValidateDetector: newXPackMLValidateDetectorFunc(t), + Validate: newXPackMLValidateFunc(t), + }, + Monitoring: &Monitoring{ + Bulk: newXPackMonitoringBulkFunc(t), + }, + Rollup: &Rollup{ + DeleteJob: newXPackRollupDeleteJobFunc(t), + GetJobs: newXPackRollupGetJobsFunc(t), + GetCaps: newXPackRollupGetRollupCapsFunc(t), + GetIndexCaps: newXPackRollupGetRollupIndexCapsFunc(t), + PutJob: newXPackRollupPutJobFunc(t), + Search: newXPackRollupRollupSearchFunc(t), + StartJob: newXPackRollupStartJobFunc(t), + StopJob: newXPackRollupStopJobFunc(t), + }, + Security: &Security{ + Authenticate: newXPackSecurityAuthenticateFunc(t), + ChangePassword: newXPackSecurityChangePasswordFunc(t), + ClearCachedRealms: newXPackSecurityClearCachedRealmsFunc(t), + ClearCachedRoles: newXPackSecurityClearCachedRolesFunc(t), + DeletePrivileges: newXPackSecurityDeletePrivilegesFunc(t), + DeleteRoleMapping: newXPackSecurityDeleteRoleMappingFunc(t), + DeleteRole: newXPackSecurityDeleteRoleFunc(t), + DeleteUser: newXPackSecurityDeleteUserFunc(t), + DisableUser: newXPackSecurityDisableUserFunc(t), + EnableUser: newXPackSecurityEnableUserFunc(t), + GetPrivileges: newXPackSecurityGetPrivilegesFunc(t), + GetRoleMapping: newXPackSecurityGetRoleMappingFunc(t), + GetRole: newXPackSecurityGetRoleFunc(t), + GetToken: newXPackSecurityGetTokenFunc(t), + GetUserPrivileges: newXPackSecurityGetUserPrivilegesFunc(t), + GetUser: newXPackSecurityGetUserFunc(t), + HasPrivileges: newXPackSecurityHasPrivilegesFunc(t), + InvalidateToken: newXPackSecurityInvalidateTokenFunc(t), + PutPrivileges: newXPackSecurityPutPrivilegesFunc(t), + PutRoleMapping: newXPackSecurityPutRoleMappingFunc(t), + PutRole: newXPackSecurityPutRoleFunc(t), + PutUser: newXPackSecurityPutUserFunc(t), + }, + SQL: &SQL{ + ClearCursor: newXPackSQLClearCursorFunc(t), + Query: newXPackSQLQueryFunc(t), + Translate: newXPackSQLTranslateFunc(t), + }, + SSL: &SSL{ + Certificates: newXPackSSLCertificatesFunc(t), + }, + Watcher: &Watcher{ + AckWatch: newXPackWatcherAckWatchFunc(t), + ActivateWatch: newXPackWatcherActivateWatchFunc(t), + DeactivateWatch: newXPackWatcherDeactivateWatchFunc(t), + DeleteWatch: newXPackWatcherDeleteWatchFunc(t), + ExecuteWatch: newXPackWatcherExecuteWatchFunc(t), + GetWatch: newXPackWatcherGetWatchFunc(t), + PutWatch: newXPackWatcherPutWatchFunc(t), + Restart: newXPackWatcherRestartFunc(t), + Start: newXPackWatcherStartFunc(t), + Stats: newXPackWatcherStatsFunc(t), + Stop: newXPackWatcherStopFunc(t), + }, + XPack: &XPack{}, }, } } diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.bulk.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.bulk.go index 3a9fccb2a..72c60904e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.bulk.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.bulk.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -137,7 +141,10 @@ func (r BulkRequest) Do(ctx context.Context, transport Transport) (*Response, er params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -321,3 +328,14 @@ func (f Bulk) WithHeader(h map[string]string) func(*BulkRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Bulk) WithOpaqueID(s string) func(*BulkRequest) { + return func(r *BulkRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.aliases.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.aliases.go index 3009a7566..599d91dbb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.aliases.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.aliases.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -118,7 +122,10 @@ func (r CatAliasesRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -274,3 +281,14 @@ func (f CatAliases) WithHeader(h map[string]string) func(*CatAliasesRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatAliases) WithOpaqueID(s string) func(*CatAliasesRequest) { + return func(r *CatAliasesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.allocation.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.allocation.go index ab85a46e4..50aa0b5f5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.allocation.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.allocation.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -123,7 +127,10 @@ func (r CatAllocationRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -287,3 +294,14 @@ func (f CatAllocation) WithHeader(h map[string]string) func(*CatAllocationReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatAllocation) WithOpaqueID(s string) func(*CatAllocationRequest) { + return func(r *CatAllocationRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.count.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.count.go index 818cf2a4c..7b6587e36 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.count.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.count.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -118,7 +122,10 @@ func (r CatCountRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -274,3 +281,14 @@ func (f CatCount) WithHeader(h map[string]string) func(*CatCountRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatCount) WithOpaqueID(s string) func(*CatCountRequest) { + return func(r *CatCountRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.fielddata.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.fielddata.go index a3d1c8bc6..1fcc53c2b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.fielddata.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.fielddata.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -127,7 +131,10 @@ func (r CatFielddataRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -291,3 +298,14 @@ func (f CatFielddata) WithHeader(h map[string]string) func(*CatFielddataRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatFielddata) WithOpaqueID(s string) func(*CatFielddataRequest) { + return func(r *CatFielddataRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.health.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.health.go index a11b99bdf..4ede1a2cc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.health.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.health.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -114,7 +118,10 @@ func (r CatHealthRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -270,3 +277,14 @@ func (f CatHealth) WithHeader(h map[string]string) func(*CatHealthRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatHealth) WithOpaqueID(s string) func(*CatHealthRequest) { + return func(r *CatHealthRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.help.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.help.go index 039009e02..05978c4bd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.help.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.help.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r CatHelpRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -191,3 +198,14 @@ func (f CatHelp) WithHeader(h map[string]string) func(*CatHelpRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatHelp) WithOpaqueID(s string) func(*CatHelpRequest) { + return func(r *CatHelpRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.indices.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.indices.go index 2c93ba732..5a78dbda0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.indices.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.indices.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -133,7 +137,10 @@ func (r CatIndicesRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -313,3 +320,14 @@ func (f CatIndices) WithHeader(h map[string]string) func(*CatIndicesRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatIndices) WithOpaqueID(s string) func(*CatIndicesRequest) { + return func(r *CatIndicesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.master.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.master.go index 54ef24c04..0318ab4f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.master.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.master.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -109,7 +113,10 @@ func (r CatMasterRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -257,3 +264,14 @@ func (f CatMaster) WithHeader(h map[string]string) func(*CatMasterRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatMaster) WithOpaqueID(s string) func(*CatMasterRequest) { + return func(r *CatMasterRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.nodeattrs.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.nodeattrs.go index 0e40f48a3..1642184db 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.nodeattrs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.nodeattrs.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -109,7 +113,10 @@ func (r CatNodeattrsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -257,3 +264,14 @@ func (f CatNodeattrs) WithHeader(h map[string]string) func(*CatNodeattrsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatNodeattrs) WithOpaqueID(s string) func(*CatNodeattrsRequest) { + return func(r *CatNodeattrsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.nodes.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.nodes.go index c3d497562..bf7c72fbd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.nodes.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.nodes.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -114,7 +118,10 @@ func (r CatNodesRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -270,3 +277,14 @@ func (f CatNodes) WithHeader(h map[string]string) func(*CatNodesRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatNodes) WithOpaqueID(s string) func(*CatNodesRequest) { + return func(r *CatNodesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.pending_tasks.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.pending_tasks.go index a1e3b4495..5b81aba01 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.pending_tasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.pending_tasks.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -109,7 +113,10 @@ func (r CatPendingTasksRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -257,3 +264,14 @@ func (f CatPendingTasks) WithHeader(h map[string]string) func(*CatPendingTasksRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatPendingTasks) WithOpaqueID(s string) func(*CatPendingTasksRequest) { + return func(r *CatPendingTasksRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.plugins.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.plugins.go index 84a037532..2e0837874 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.plugins.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.plugins.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -109,7 +113,10 @@ func (r CatPluginsRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -257,3 +264,14 @@ func (f CatPlugins) WithHeader(h map[string]string) func(*CatPluginsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatPlugins) WithOpaqueID(s string) func(*CatPluginsRequest) { + return func(r *CatPluginsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.recovery.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.recovery.go index 7e6b6a7ef..47b3aa377 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.recovery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.recovery.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -118,7 +122,10 @@ func (r CatRecoveryRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -274,3 +281,14 @@ func (f CatRecovery) WithHeader(h map[string]string) func(*CatRecoveryRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatRecovery) WithOpaqueID(s string) func(*CatRecoveryRequest) { + return func(r *CatRecoveryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.repositories.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.repositories.go index 34e4bc98c..c96e40fcb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.repositories.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.repositories.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -109,7 +113,10 @@ func (r CatRepositoriesRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -257,3 +264,14 @@ func (f CatRepositories) WithHeader(h map[string]string) func(*CatRepositoriesRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatRepositories) WithOpaqueID(s string) func(*CatRepositoriesRequest) { + return func(r *CatRepositoriesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.segments.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.segments.go index ee757a46a..915b35733 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.segments.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.segments.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -112,7 +116,10 @@ func (r CatSegmentsRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -260,3 +267,14 @@ func (f CatSegments) WithHeader(h map[string]string) func(*CatSegmentsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatSegments) WithOpaqueID(s string) func(*CatSegmentsRequest) { + return func(r *CatSegmentsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.shards.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.shards.go index 5ab434592..009b26fd1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.shards.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.shards.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -123,7 +127,10 @@ func (r CatShardsRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -287,3 +294,14 @@ func (f CatShards) WithHeader(h map[string]string) func(*CatShardsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatShards) WithOpaqueID(s string) func(*CatShardsRequest) { + return func(r *CatShardsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.snapshots.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.snapshots.go index 231d5231d..b8b505e02 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.snapshots.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.snapshots.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -118,7 +122,10 @@ func (r CatSnapshotsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -274,3 +281,14 @@ func (f CatSnapshots) WithHeader(h map[string]string) func(*CatSnapshotsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatSnapshots) WithOpaqueID(s string) func(*CatSnapshotsRequest) { + return func(r *CatSnapshotsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.tasks.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.tasks.go index 15e83ab96..ab24fefdd 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.tasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.tasks.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -118,7 +122,10 @@ func (r CatTasksRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -282,3 +289,14 @@ func (f CatTasks) WithHeader(h map[string]string) func(*CatTasksRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatTasks) WithOpaqueID(s string) func(*CatTasksRequest) { + return func(r *CatTasksRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.templates.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.templates.go index adaafbed8..df4490be7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.templates.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.templates.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -118,7 +122,10 @@ func (r CatTemplatesRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -274,3 +281,14 @@ func (f CatTemplates) WithHeader(h map[string]string) func(*CatTemplatesRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatTemplates) WithOpaqueID(s string) func(*CatTemplatesRequest) { + return func(r *CatTemplatesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.thread_pool.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.thread_pool.go index 485646ddc..c52d528f6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.thread_pool.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cat.thread_pool.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -124,7 +128,10 @@ func (r CatThreadPoolRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -288,3 +295,14 @@ func (f CatThreadPool) WithHeader(h map[string]string) func(*CatThreadPoolReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CatThreadPool) WithOpaqueID(s string) func(*CatThreadPoolRequest) { + return func(r *CatThreadPoolRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.clear_scroll.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.clear_scroll.go index b2a555c2e..a7f58807e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.clear_scroll.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.clear_scroll.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r ClearScrollRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,3 +202,14 @@ func (f ClearScroll) WithHeader(h map[string]string) func(*ClearScrollRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClearScroll) WithOpaqueID(s string) func(*ClearScrollRequest) { + return func(r *ClearScrollRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.allocation_explain.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.allocation_explain.go index e8d5b04e4..a40846934 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.allocation_explain.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.allocation_explain.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -86,7 +90,10 @@ func (r ClusterAllocationExplainRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -206,3 +213,14 @@ func (f ClusterAllocationExplain) WithHeader(h map[string]string) func(*ClusterA } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterAllocationExplain) WithOpaqueID(s string) func(*ClusterAllocationExplainRequest) { + return func(r *ClusterAllocationExplainRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.get_settings.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.get_settings.go index df833ff93..31156f015 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.get_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.get_settings.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -94,7 +98,10 @@ func (r ClusterGetSettingsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -218,3 +225,14 @@ func (f ClusterGetSettings) WithHeader(h map[string]string) func(*ClusterGetSett } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterGetSettings) WithOpaqueID(s string) func(*ClusterGetSettingsRequest) { + return func(r *ClusterGetSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.health.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.health.go index 6c50ac3c9..8b2ffeb2b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.health.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.health.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -133,7 +137,10 @@ func (r ClusterHealthRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -313,3 +320,14 @@ func (f ClusterHealth) WithHeader(h map[string]string) func(*ClusterHealthReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterHealth) WithOpaqueID(s string) func(*ClusterHealthRequest) { + return func(r *ClusterHealthRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.pending_tasks.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.pending_tasks.go index bc0779145..f4b5c5a1b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.pending_tasks.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.pending_tasks.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -85,7 +89,10 @@ func (r ClusterPendingTasksRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -193,3 +200,14 @@ func (f ClusterPendingTasks) WithHeader(h map[string]string) func(*ClusterPendin } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterPendingTasks) WithOpaqueID(s string) func(*ClusterPendingTasksRequest) { + return func(r *ClusterPendingTasksRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.put_settings.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.put_settings.go index 45445a6cc..1892629bf 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.put_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.put_settings.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -92,7 +96,10 @@ func (r ClusterPutSettingsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -212,3 +219,14 @@ func (f ClusterPutSettings) WithHeader(h map[string]string) func(*ClusterPutSett } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterPutSettings) WithOpaqueID(s string) func(*ClusterPutSettingsRequest) { + return func(r *ClusterPutSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.remote_info.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.remote_info.go index 098768eb9..7a92520a3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.remote_info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.remote_info.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -71,7 +75,10 @@ func (r ClusterRemoteInfoRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -163,3 +170,14 @@ func (f ClusterRemoteInfo) WithHeader(h map[string]string) func(*ClusterRemoteIn } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterRemoteInfo) WithOpaqueID(s string) func(*ClusterRemoteInfoRequest) { + return func(r *ClusterRemoteInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.reroute.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.reroute.go index 63c24f16d..61754b2e2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.reroute.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.reroute.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -107,7 +111,10 @@ func (r ClusterRerouteRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -259,3 +266,14 @@ func (f ClusterReroute) WithHeader(h map[string]string) func(*ClusterRerouteRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterReroute) WithOpaqueID(s string) func(*ClusterRerouteRequest) { + return func(r *ClusterRerouteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.state.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.state.go index 42469fecc..422e31d61 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.state.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.state.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -129,7 +133,10 @@ func (r ClusterStateRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -301,3 +308,14 @@ func (f ClusterState) WithHeader(h map[string]string) func(*ClusterStateRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterState) WithOpaqueID(s string) func(*ClusterStateRequest) { + return func(r *ClusterStateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.stats.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.stats.go index f97c373d7..3f570f2da 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.cluster.stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -95,7 +99,10 @@ func (r ClusterStatsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -211,3 +218,14 @@ func (f ClusterStats) WithHeader(h map[string]string) func(*ClusterStatsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ClusterStats) WithOpaqueID(s string) func(*ClusterStatsRequest) { + return func(r *ClusterStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.count.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.count.go index ff7dcfd88..9df2946d7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.count.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.count.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -158,7 +162,10 @@ func (r CountRequest) Do(ctx context.Context, transport Transport) (*Response, e params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -390,3 +397,14 @@ func (f Count) WithHeader(h map[string]string) func(*CountRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Count) WithOpaqueID(s string) func(*CountRequest) { + return func(r *CountRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.create.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.create.go index ecc2548ac..520023742 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.create.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.create.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -134,7 +138,10 @@ func (r CreateRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -302,3 +309,14 @@ func (f Create) WithHeader(h map[string]string) func(*CreateRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Create) WithOpaqueID(s string) func(*CreateRequest) { + return func(r *CreateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete.go index aa709425b..cf7fe21f2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -132,7 +136,10 @@ func (r DeleteRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -304,3 +311,14 @@ func (f Delete) WithHeader(h map[string]string) func(*DeleteRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Delete) WithOpaqueID(s string) func(*DeleteRequest) { + return func(r *DeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete_by_query.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete_by_query.go index 733af0c68..7389824e5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete_by_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete_by_query.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -247,7 +251,10 @@ func (r DeleteByQueryRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -607,3 +614,14 @@ func (f DeleteByQuery) WithHeader(h map[string]string) func(*DeleteByQueryReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DeleteByQuery) WithOpaqueID(s string) func(*DeleteByQueryRequest) { + return func(r *DeleteByQueryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete_by_query_rethrottle.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete_by_query_rethrottle.go index bcff8b0e7..1da070fac 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete_by_query_rethrottle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete_by_query_rethrottle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -85,7 +89,10 @@ func (r DeleteByQueryRethrottleRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -185,3 +192,14 @@ func (f DeleteByQueryRethrottle) WithHeader(h map[string]string) func(*DeleteByQ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DeleteByQueryRethrottle) WithOpaqueID(s string) func(*DeleteByQueryRethrottleRequest) { + return func(r *DeleteByQueryRethrottleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete_script.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete_script.go index 83c20cd99..d165044bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete_script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.delete_script.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -88,7 +92,10 @@ func (r DeleteScriptRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -196,3 +203,14 @@ func (f DeleteScript) WithHeader(h map[string]string) func(*DeleteScriptRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f DeleteScript) WithOpaqueID(s string) func(*DeleteScriptRequest) { + return func(r *DeleteScriptRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.exists.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.exists.go index 30dabc754..fe220f1f1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.exists.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.exists.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -141,7 +145,10 @@ func (r ExistsRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -329,3 +336,14 @@ func (f Exists) WithHeader(h map[string]string) func(*ExistsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Exists) WithOpaqueID(s string) func(*ExistsRequest) { + return func(r *ExistsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.exists_source.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.exists_source.go index e9504ad42..9e12889c7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.exists_source.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.exists_source.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -134,7 +138,10 @@ func (r ExistsSourceRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -314,3 +321,14 @@ func (f ExistsSource) WithHeader(h map[string]string) func(*ExistsSourceRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ExistsSource) WithOpaqueID(s string) func(*ExistsSourceRequest) { + return func(r *ExistsSourceRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.explain.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.explain.go index d06776974..6dc3ba352 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.explain.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.explain.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -156,7 +160,10 @@ func (r ExplainRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -372,3 +379,14 @@ func (f Explain) WithHeader(h map[string]string) func(*ExplainRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Explain) WithOpaqueID(s string) func(*ExplainRequest) { + return func(r *ExplainRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.field_caps.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.field_caps.go index dfe0f479c..46b952c37 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.field_caps.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.field_caps.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -103,7 +107,10 @@ func (r FieldCapsRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -247,3 +254,14 @@ func (f FieldCaps) WithHeader(h map[string]string) func(*FieldCapsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f FieldCaps) WithOpaqueID(s string) func(*FieldCapsRequest) { + return func(r *FieldCapsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.get.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.get.go index eda2747f8..dfe430e93 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.get.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -151,7 +155,10 @@ func (r GetRequest) Do(ctx context.Context, transport Transport) (*Response, err params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -355,3 +362,14 @@ func (f Get) WithHeader(h map[string]string) func(*GetRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Get) WithOpaqueID(s string) func(*GetRequest) { + return func(r *GetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.get_script.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.get_script.go index 9f3f5fbe1..4c7949695 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.get_script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.get_script.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r GetScriptRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -183,3 +190,14 @@ func (f GetScript) WithHeader(h map[string]string) func(*GetScriptRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f GetScript) WithOpaqueID(s string) func(*GetScriptRequest) { + return func(r *GetScriptRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.get_source.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.get_source.go index 04e6e7c4c..ac726cee1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.get_source.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.get_source.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -138,7 +142,10 @@ func (r GetSourceRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -318,3 +325,14 @@ func (f GetSource) WithHeader(h map[string]string) func(*GetSourceRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f GetSource) WithOpaqueID(s string) func(*GetSourceRequest) { + return func(r *GetSourceRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.index.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.index.go index 67dedfc82..1497ef7ff 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.index.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.index.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -151,7 +155,10 @@ func (r IndexRequest) Do(ctx context.Context, transport Transport) (*Response, e params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -351,3 +358,14 @@ func (f Index) WithHeader(h map[string]string) func(*IndexRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Index) WithOpaqueID(s string) func(*IndexRequest) { + return func(r *IndexRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.analyze.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.analyze.go index cfaa80dc7..18ad5c348 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.analyze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.analyze.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -85,7 +89,10 @@ func (r IndicesAnalyzeRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -197,3 +204,14 @@ func (f IndicesAnalyze) WithHeader(h map[string]string) func(*IndicesAnalyzeRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesAnalyze) WithOpaqueID(s string) func(*IndicesAnalyzeRequest) { + return func(r *IndicesAnalyzeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.clear_cache.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.clear_cache.go index 419d34534..3cf8ef215 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.clear_cache.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.clear_cache.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -34,8 +38,8 @@ type IndicesClearCacheRequest struct { AllowNoIndices *bool ExpandWildcards string - FieldData *bool Fielddata *bool + FieldData *bool Fields []string IgnoreUnavailable *bool Query *bool @@ -83,14 +87,14 @@ func (r IndicesClearCacheRequest) Do(ctx context.Context, transport Transport) ( params["expand_wildcards"] = r.ExpandWildcards } - if r.FieldData != nil { - params["field_data"] = strconv.FormatBool(*r.FieldData) - } - if r.Fielddata != nil { params["fielddata"] = strconv.FormatBool(*r.Fielddata) } + if r.FieldData != nil { + params["field_data"] = strconv.FormatBool(*r.FieldData) + } + if len(r.Fields) > 0 { params["fields"] = strings.Join(r.Fields, ",") } @@ -131,7 +135,10 @@ func (r IndicesClearCacheRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -203,19 +210,19 @@ func (f IndicesClearCache) WithExpandWildcards(v string) func(*IndicesClearCache } } -// WithFieldData - clear field data. this is deprecated. prefer `fielddata`.. +// WithFielddata - clear field data. // -func (f IndicesClearCache) WithFieldData(v bool) func(*IndicesClearCacheRequest) { +func (f IndicesClearCache) WithFielddata(v bool) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { - r.FieldData = &v + r.Fielddata = &v } } -// WithFielddata - clear field data. +// WithFieldData - clear field data. this is deprecated. prefer `fielddata`.. // -func (f IndicesClearCache) WithFielddata(v bool) func(*IndicesClearCacheRequest) { +func (f IndicesClearCache) WithFieldData(v bool) func(*IndicesClearCacheRequest) { return func(r *IndicesClearCacheRequest) { - r.Fielddata = &v + r.FieldData = &v } } @@ -303,3 +310,14 @@ func (f IndicesClearCache) WithHeader(h map[string]string) func(*IndicesClearCac } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesClearCache) WithOpaqueID(s string) func(*IndicesClearCacheRequest) { + return func(r *IndicesClearCacheRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.close.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.close.go index 6b47e6d1f..032a01744 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.close.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.close.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -104,7 +108,10 @@ func (r IndicesCloseRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -236,3 +243,14 @@ func (f IndicesClose) WithHeader(h map[string]string) func(*IndicesCloseRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesClose) WithOpaqueID(s string) func(*IndicesCloseRequest) { + return func(r *IndicesCloseRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.create.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.create.go index 6daf43a38..41a925fe5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.create.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.create.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -105,7 +109,10 @@ func (r IndicesCreateRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -249,3 +256,14 @@ func (f IndicesCreate) WithHeader(h map[string]string) func(*IndicesCreateReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesCreate) WithOpaqueID(s string) func(*IndicesCreateRequest) { + return func(r *IndicesCreateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.delete.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.delete.go index 290eed532..02a388414 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.delete.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -102,7 +106,10 @@ func (r IndicesDeleteRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -234,3 +241,14 @@ func (f IndicesDelete) WithHeader(h map[string]string) func(*IndicesDeleteReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesDelete) WithOpaqueID(s string) func(*IndicesDeleteRequest) { + return func(r *IndicesDeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.delete_alias.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.delete_alias.go index a78dc81f6..3bd7a9213 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.delete_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.delete_alias.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -92,7 +96,10 @@ func (r IndicesDeleteAliasRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -200,3 +207,14 @@ func (f IndicesDeleteAlias) WithHeader(h map[string]string) func(*IndicesDeleteA } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesDeleteAlias) WithOpaqueID(s string) func(*IndicesDeleteAliasRequest) { + return func(r *IndicesDeleteAliasRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.delete_template.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.delete_template.go index faf84eee9..fbdcf2012 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.delete_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.delete_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -88,7 +92,10 @@ func (r IndicesDeleteTemplateRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -196,3 +203,14 @@ func (f IndicesDeleteTemplate) WithHeader(h map[string]string) func(*IndicesDele } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesDeleteTemplate) WithOpaqueID(s string) func(*IndicesDeleteTemplateRequest) { + return func(r *IndicesDeleteTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists.go index 73e59801f..b6fcd6c33 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -106,7 +110,10 @@ func (r IndicesExistsRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -246,3 +253,14 @@ func (f IndicesExists) WithHeader(h map[string]string) func(*IndicesExistsReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesExists) WithOpaqueID(s string) func(*IndicesExistsRequest) { + return func(r *IndicesExistsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists_alias.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists_alias.go index ce37e2429..74c7ab0c9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists_alias.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -104,7 +108,10 @@ func (r IndicesExistsAliasRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -236,3 +243,14 @@ func (f IndicesExistsAlias) WithHeader(h map[string]string) func(*IndicesExistsA } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesExistsAlias) WithOpaqueID(s string) func(*IndicesExistsAliasRequest) { + return func(r *IndicesExistsAliasRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists_template.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists_template.go index 8b2455aa1..b92cd738e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -94,7 +98,10 @@ func (r IndicesExistsTemplateRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -210,3 +217,14 @@ func (f IndicesExistsTemplate) WithHeader(h map[string]string) func(*IndicesExis } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesExistsTemplate) WithOpaqueID(s string) func(*IndicesExistsTemplateRequest) { + return func(r *IndicesExistsTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists_type.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists_type.go index 3a869aea9..3321aac61 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists_type.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.exists_type.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -101,7 +105,10 @@ func (r IndicesExistsDocumentTypeRequest) Do(ctx context.Context, transport Tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -233,3 +240,14 @@ func (f IndicesExistsDocumentType) WithHeader(h map[string]string) func(*Indices } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesExistsDocumentType) WithOpaqueID(s string) func(*IndicesExistsDocumentTypeRequest) { + return func(r *IndicesExistsDocumentTypeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.flush.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.flush.go index 5c1b6d2e1..a35b20f27 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.flush.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.flush.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -105,7 +109,10 @@ func (r IndicesFlushRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -245,3 +252,14 @@ func (f IndicesFlush) WithHeader(h map[string]string) func(*IndicesFlushRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesFlush) WithOpaqueID(s string) func(*IndicesFlushRequest) { + return func(r *IndicesFlushRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.flush_synced.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.flush_synced.go index 47b7cfcdb..e007b08b5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.flush_synced.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.flush_synced.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -97,7 +101,10 @@ func (r IndicesFlushSyncedRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -221,3 +228,14 @@ func (f IndicesFlushSynced) WithHeader(h map[string]string) func(*IndicesFlushSy } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesFlushSynced) WithOpaqueID(s string) func(*IndicesFlushSyncedRequest) { + return func(r *IndicesFlushSyncedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.forcemerge.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.forcemerge.go index 157fdaa4e..d05db6c73 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.forcemerge.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.forcemerge.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -110,7 +114,10 @@ func (r IndicesForcemergeRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -258,3 +265,14 @@ func (f IndicesForcemerge) WithHeader(h map[string]string) func(*IndicesForcemer } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesForcemerge) WithOpaqueID(s string) func(*IndicesForcemergeRequest) { + return func(r *IndicesForcemergeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get.go index cd85dd2dd..5e3a8c921 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -117,7 +121,10 @@ func (r IndicesGetRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -273,3 +280,14 @@ func (f IndicesGet) WithHeader(h map[string]string) func(*IndicesGetRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGet) WithOpaqueID(s string) func(*IndicesGetRequest) { + return func(r *IndicesGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_alias.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_alias.go index fb639df2e..46d3e9054 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_alias.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -106,7 +110,10 @@ func (r IndicesGetAliasRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -246,3 +253,14 @@ func (f IndicesGetAlias) WithHeader(h map[string]string) func(*IndicesGetAliasRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGetAlias) WithOpaqueID(s string) func(*IndicesGetAliasRequest) { + return func(r *IndicesGetAliasRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_field_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_field_mapping.go index eebc5a11b..a0a7ca9bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_field_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_field_mapping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -121,7 +125,10 @@ func (r IndicesGetFieldMappingRequest) Do(ctx context.Context, transport Transpo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -277,3 +284,14 @@ func (f IndicesGetFieldMapping) WithHeader(h map[string]string) func(*IndicesGet } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGetFieldMapping) WithOpaqueID(s string) func(*IndicesGetFieldMappingRequest) { + return func(r *IndicesGetFieldMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_mapping.go index 71ae81c98..b7cada3ca 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_mapping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -116,7 +120,10 @@ func (r IndicesGetMappingRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -272,3 +279,14 @@ func (f IndicesGetMapping) WithHeader(h map[string]string) func(*IndicesGetMappi } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGetMapping) WithOpaqueID(s string) func(*IndicesGetMappingRequest) { + return func(r *IndicesGetMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_settings.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_settings.go index 1e5c3c91f..5fc617bac 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_settings.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -122,7 +126,10 @@ func (r IndicesGetSettingsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -286,3 +293,14 @@ func (f IndicesGetSettings) WithHeader(h map[string]string) func(*IndicesGetSett } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGetSettings) WithOpaqueID(s string) func(*IndicesGetSettingsRequest) { + return func(r *IndicesGetSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_template.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_template.go index 99fb5607c..982293ec4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -101,7 +105,10 @@ func (r IndicesGetTemplateRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -233,3 +240,14 @@ func (f IndicesGetTemplate) WithHeader(h map[string]string) func(*IndicesGetTemp } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGetTemplate) WithOpaqueID(s string) func(*IndicesGetTemplateRequest) { + return func(r *IndicesGetTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_upgrade.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_upgrade.go index f242d2ef7..e51d9c23b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_upgrade.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.get_upgrade.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -95,7 +99,10 @@ func (r IndicesGetUpgradeRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -219,3 +226,14 @@ func (f IndicesGetUpgrade) WithHeader(h map[string]string) func(*IndicesGetUpgra } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesGetUpgrade) WithOpaqueID(s string) func(*IndicesGetUpgradeRequest) { + return func(r *IndicesGetUpgradeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.open.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.open.go index 905264be2..6e40308f4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.open.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.open.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -109,7 +113,10 @@ func (r IndicesOpenRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -249,3 +256,14 @@ func (f IndicesOpen) WithHeader(h map[string]string) func(*IndicesOpenRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesOpen) WithOpaqueID(s string) func(*IndicesOpenRequest) { + return func(r *IndicesOpenRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_alias.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_alias.go index fcb331592..bb282476b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_alias.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_alias.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -95,7 +99,10 @@ func (r IndicesPutAliasRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -215,3 +222,14 @@ func (f IndicesPutAlias) WithHeader(h map[string]string) func(*IndicesPutAliasRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesPutAlias) WithOpaqueID(s string) func(*IndicesPutAliasRequest) { + return func(r *IndicesPutAliasRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_mapping.go index 7be227a24..be01c6ab0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_mapping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -124,7 +128,10 @@ func (r IndicesPutMappingRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -292,3 +299,14 @@ func (f IndicesPutMapping) WithHeader(h map[string]string) func(*IndicesPutMappi } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesPutMapping) WithOpaqueID(s string) func(*IndicesPutMappingRequest) { + return func(r *IndicesPutMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_settings.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_settings.go index 19b2991a2..82aabcc30 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_settings.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -119,7 +123,10 @@ func (r IndicesPutSettingsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -279,3 +286,14 @@ func (f IndicesPutSettings) WithHeader(h map[string]string) func(*IndicesPutSett } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesPutSettings) WithOpaqueID(s string) func(*IndicesPutSettingsRequest) { + return func(r *IndicesPutSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_template.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_template.go index d22fe350f..de4aa1492 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.put_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -112,7 +116,10 @@ func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -256,3 +263,14 @@ func (f IndicesPutTemplate) WithHeader(h map[string]string) func(*IndicesPutTemp } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesPutTemplate) WithOpaqueID(s string) func(*IndicesPutTemplateRequest) { + return func(r *IndicesPutTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.recovery.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.recovery.go index 17b1ee022..cfc46bde4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.recovery.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.recovery.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -90,7 +94,10 @@ func (r IndicesRecoveryRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -206,3 +213,14 @@ func (f IndicesRecovery) WithHeader(h map[string]string) func(*IndicesRecoveryRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesRecovery) WithOpaqueID(s string) func(*IndicesRecoveryRequest) { + return func(r *IndicesRecoveryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.refresh.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.refresh.go index 5bc8f1727..16c14e20e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.refresh.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.refresh.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -95,7 +99,10 @@ func (r IndicesRefreshRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -219,3 +226,14 @@ func (f IndicesRefresh) WithHeader(h map[string]string) func(*IndicesRefreshRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesRefresh) WithOpaqueID(s string) func(*IndicesRefreshRequest) { + return func(r *IndicesRefreshRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.rollover.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.rollover.go index 319b91527..4269bbd91 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.rollover.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.rollover.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -113,7 +117,10 @@ func (r IndicesRolloverRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -265,3 +272,14 @@ func (f IndicesRollover) WithHeader(h map[string]string) func(*IndicesRolloverRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesRollover) WithOpaqueID(s string) func(*IndicesRolloverRequest) { + return func(r *IndicesRolloverRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.segments.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.segments.go index 943624983..006f69e32 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.segments.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.segments.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -100,7 +104,10 @@ func (r IndicesSegmentsRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -232,3 +239,14 @@ func (f IndicesSegments) WithHeader(h map[string]string) func(*IndicesSegmentsRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesSegments) WithOpaqueID(s string) func(*IndicesSegmentsRequest) { + return func(r *IndicesSegmentsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.shard_stores.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.shard_stores.go index 0c75f3255..2298a8377 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.shard_stores.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.shard_stores.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -100,7 +104,10 @@ func (r IndicesShardStoresRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -232,3 +239,14 @@ func (f IndicesShardStores) WithHeader(h map[string]string) func(*IndicesShardSt } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesShardStores) WithOpaqueID(s string) func(*IndicesShardStoresRequest) { + return func(r *IndicesShardStoresRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.shrink.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.shrink.go index cfa4f4de1..7f1e4c808 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.shrink.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.shrink.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -106,7 +110,10 @@ func (r IndicesShrinkRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -242,3 +249,14 @@ func (f IndicesShrink) WithHeader(h map[string]string) func(*IndicesShrinkReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesShrink) WithOpaqueID(s string) func(*IndicesShrinkRequest) { + return func(r *IndicesShrinkRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.split.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.split.go index aa4aab589..3bfac4ba5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.split.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.split.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -106,7 +110,10 @@ func (r IndicesSplitRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -242,3 +249,14 @@ func (f IndicesSplit) WithHeader(h map[string]string) func(*IndicesSplitRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesSplit) WithOpaqueID(s string) func(*IndicesSplitRequest) { + return func(r *IndicesSplitRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.stats.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.stats.go index 3e998ff1f..bcf2e841c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -121,7 +125,10 @@ func (r IndicesStatsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -285,3 +292,14 @@ func (f IndicesStats) WithHeader(h map[string]string) func(*IndicesStatsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesStats) WithOpaqueID(s string) func(*IndicesStatsRequest) { + return func(r *IndicesStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.update_aliases.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.update_aliases.go index 3e749d224..6afea0c2d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.update_aliases.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.update_aliases.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -86,7 +90,10 @@ func (r IndicesUpdateAliasesRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -198,3 +205,14 @@ func (f IndicesUpdateAliases) WithHeader(h map[string]string) func(*IndicesUpdat } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesUpdateAliases) WithOpaqueID(s string) func(*IndicesUpdateAliasesRequest) { + return func(r *IndicesUpdateAliasesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.upgrade.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.upgrade.go index ab34b6484..7abc00be3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.upgrade.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.upgrade.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -105,7 +109,10 @@ func (r IndicesUpgradeRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -245,3 +252,14 @@ func (f IndicesUpgrade) WithHeader(h map[string]string) func(*IndicesUpgradeRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesUpgrade) WithOpaqueID(s string) func(*IndicesUpgradeRequest) { + return func(r *IndicesUpgradeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.validate_query.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.validate_query.go index b358ced14..b8b2e0167 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.validate_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.indices.validate_query.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -150,7 +154,10 @@ func (r IndicesValidateQueryRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -366,3 +373,14 @@ func (f IndicesValidateQuery) WithHeader(h map[string]string) func(*IndicesValid } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesValidateQuery) WithOpaqueID(s string) func(*IndicesValidateQueryRequest) { + return func(r *IndicesValidateQueryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.info.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.info.go index fd098f183..9a15c664b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.info.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -71,7 +75,10 @@ func (r InfoRequest) Do(ctx context.Context, transport Transport) (*Response, er params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -155,3 +162,14 @@ func (f Info) WithHeader(h map[string]string) func(*InfoRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Info) WithOpaqueID(s string) func(*InfoRequest) { + return func(r *InfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.delete_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.delete_pipeline.go index 92f0e6a71..b494f08b6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.delete_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.delete_pipeline.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -90,7 +94,10 @@ func (r IngestDeletePipelineRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -198,3 +205,14 @@ func (f IngestDeletePipeline) WithHeader(h map[string]string) func(*IngestDelete } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IngestDeletePipeline) WithOpaqueID(s string) func(*IngestDeletePipelineRequest) { + return func(r *IngestDeletePipelineRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.get_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.get_pipeline.go index d45186e01..bef1ace27 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.get_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.get_pipeline.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -87,7 +91,10 @@ func (r IngestGetPipelineRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,3 +202,14 @@ func (f IngestGetPipeline) WithHeader(h map[string]string) func(*IngestGetPipeli } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IngestGetPipeline) WithOpaqueID(s string) func(*IngestGetPipelineRequest) { + return func(r *IngestGetPipelineRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.processor_grok.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.processor_grok.go index 4f1b703d2..a0cfc83bb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.processor_grok.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.processor_grok.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -71,7 +75,10 @@ func (r IngestProcessorGrokRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -163,3 +170,14 @@ func (f IngestProcessorGrok) WithHeader(h map[string]string) func(*IngestProcess } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IngestProcessorGrok) WithOpaqueID(s string) func(*IngestProcessorGrokRequest) { + return func(r *IngestProcessorGrokRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.put_pipeline.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.put_pipeline.go index fd41807b7..990b9b809 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.put_pipeline.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.put_pipeline.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -93,7 +97,10 @@ func (r IngestPutPipelineRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -205,3 +212,14 @@ func (f IngestPutPipeline) WithHeader(h map[string]string) func(*IngestPutPipeli } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IngestPutPipeline) WithOpaqueID(s string) func(*IngestPutPipelineRequest) { + return func(r *IngestPutPipelineRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.simulate.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.simulate.go index 7dded6edb..15ab59e82 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.simulate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ingest.simulate.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -92,7 +96,10 @@ func (r IngestSimulateRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -204,3 +211,14 @@ func (f IngestSimulate) WithHeader(h map[string]string) func(*IngestSimulateRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IngestSimulate) WithOpaqueID(s string) func(*IngestSimulateRequest) { + return func(r *IngestSimulateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.mget.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.mget.go index 44a519ea5..d7ae0659e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.mget.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.mget.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -128,7 +132,10 @@ func (r MgetRequest) Do(ctx context.Context, transport Transport) (*Response, er params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -304,3 +311,14 @@ func (f Mget) WithHeader(h map[string]string) func(*MgetRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Mget) WithOpaqueID(s string) func(*MgetRequest) { + return func(r *MgetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.msearch.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.msearch.go index 5bca8ae73..520175032 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.msearch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.msearch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -118,7 +122,10 @@ func (r MsearchRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -278,3 +285,14 @@ func (f Msearch) WithHeader(h map[string]string) func(*MsearchRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Msearch) WithOpaqueID(s string) func(*MsearchRequest) { + return func(r *MsearchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.msearch_template.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.msearch_template.go index 1e890c31e..881e46504 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.msearch_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.msearch_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -110,7 +114,10 @@ func (r MsearchTemplateRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -254,3 +261,14 @@ func (f MsearchTemplate) WithHeader(h map[string]string) func(*MsearchTemplateRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f MsearchTemplate) WithOpaqueID(s string) func(*MsearchTemplateRequest) { + return func(r *MsearchTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.mtermvectors.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.mtermvectors.go index 0293e1df9..eed9b0069 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.mtermvectors.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.mtermvectors.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -153,7 +157,10 @@ func (r MtermvectorsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -377,3 +384,14 @@ func (f Mtermvectors) WithHeader(h map[string]string) func(*MtermvectorsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Mtermvectors) WithOpaqueID(s string) func(*MtermvectorsRequest) { + return func(r *MtermvectorsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.hot_threads.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.hot_threads.go index 9fabd3291..294a3ea46 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.hot_threads.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.hot_threads.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -115,7 +119,10 @@ func (r NodesHotThreadsRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -263,3 +270,14 @@ func (f NodesHotThreads) WithHeader(h map[string]string) func(*NodesHotThreadsRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f NodesHotThreads) WithOpaqueID(s string) func(*NodesHotThreadsRequest) { + return func(r *NodesHotThreadsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.info.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.info.go index 628b0b818..d169286fe 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.info.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -96,7 +100,10 @@ func (r NodesInfoRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -220,3 +227,14 @@ func (f NodesInfo) WithHeader(h map[string]string) func(*NodesInfoRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f NodesInfo) WithOpaqueID(s string) func(*NodesInfoRequest) { + return func(r *NodesInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.reload_secure_settings.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.reload_secure_settings.go index 820aaee80..fd9130953 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.reload_secure_settings.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.reload_secure_settings.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -87,7 +91,10 @@ func (r NodesReloadSecureSettingsRequest) Do(ctx context.Context, transport Tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,3 +202,14 @@ func (f NodesReloadSecureSettings) WithHeader(h map[string]string) func(*NodesRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f NodesReloadSecureSettings) WithOpaqueID(s string) func(*NodesReloadSecureSettingsRequest) { + return func(r *NodesReloadSecureSettingsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.stats.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.stats.go index 06a8acf6f..bb25fd132 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -133,7 +137,10 @@ func (r NodesStatsRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -313,3 +320,14 @@ func (f NodesStats) WithHeader(h map[string]string) func(*NodesStatsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f NodesStats) WithOpaqueID(s string) func(*NodesStatsRequest) { + return func(r *NodesStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.usage.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.usage.go index 9a3c2f6ce..d4b42f614 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.usage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.nodes.usage.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -92,7 +96,10 @@ func (r NodesUsageRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -208,3 +215,14 @@ func (f NodesUsage) WithHeader(h map[string]string) func(*NodesUsageRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f NodesUsage) WithOpaqueID(s string) func(*NodesUsageRequest) { + return func(r *NodesUsageRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ping.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ping.go index 6c89f01ea..67d69dd91 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.ping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -71,7 +75,10 @@ func (r PingRequest) Do(ctx context.Context, transport Transport) (*Response, er params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -163,3 +170,14 @@ func (f Ping) WithHeader(h map[string]string) func(*PingRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Ping) WithOpaqueID(s string) func(*PingRequest) { + return func(r *PingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.put_script.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.put_script.go index 8c1c1ad71..96660e81c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.put_script.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.put_script.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -101,7 +105,10 @@ func (r PutScriptRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -221,3 +228,14 @@ func (f PutScript) WithHeader(h map[string]string) func(*PutScriptRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f PutScript) WithOpaqueID(s string) func(*PutScriptRequest) { + return func(r *PutScriptRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.rank_eval.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.rank_eval.go index 116b3b7ce..d14f6eef9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.rank_eval.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.rank_eval.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -98,7 +102,10 @@ func (r RankEvalRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -226,3 +233,14 @@ func (f RankEval) WithHeader(h map[string]string) func(*RankEvalRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f RankEval) WithOpaqueID(s string) func(*RankEvalRequest) { + return func(r *RankEvalRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.reindex.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.reindex.go index 00e15c0db..d5dd5601f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.reindex.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.reindex.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -109,7 +113,10 @@ func (r ReindexRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -253,3 +260,14 @@ func (f Reindex) WithHeader(h map[string]string) func(*ReindexRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Reindex) WithOpaqueID(s string) func(*ReindexRequest) { + return func(r *ReindexRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.reindex_rethrottle.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.reindex_rethrottle.go index d68cb3425..c63baa756 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.reindex_rethrottle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.reindex_rethrottle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -85,7 +89,10 @@ func (r ReindexRethrottleRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -185,3 +192,14 @@ func (f ReindexRethrottle) WithHeader(h map[string]string) func(*ReindexRethrott } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ReindexRethrottle) WithOpaqueID(s string) func(*ReindexRethrottleRequest) { + return func(r *ReindexRethrottleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.render_search_template.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.render_search_template.go index 8b5f93831..3f806d6c5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.render_search_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.render_search_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r RenderSearchTemplateRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,3 +202,14 @@ func (f RenderSearchTemplate) WithHeader(h map[string]string) func(*RenderSearch } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f RenderSearchTemplate) WithOpaqueID(s string) func(*RenderSearchTemplateRequest) { + return func(r *RenderSearchTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.scripts_painless_execute.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.scripts_painless_execute.go index 4cff51781..66cc054c0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.scripts_painless_execute.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.scripts_painless_execute.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -74,7 +78,10 @@ func (r ScriptsPainlessExecuteRequest) Do(ctx context.Context, transport Transpo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -178,3 +185,14 @@ func (f ScriptsPainlessExecute) WithHeader(h map[string]string) func(*ScriptsPai } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ScriptsPainlessExecute) WithOpaqueID(s string) func(*ScriptsPainlessExecuteRequest) { + return func(r *ScriptsPainlessExecuteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.scroll.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.scroll.go index a19bb9713..454c4e0da 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.scroll.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.scroll.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -93,7 +97,10 @@ func (r ScrollRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -221,3 +228,14 @@ func (f Scroll) WithHeader(h map[string]string) func(*ScrollRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Scroll) WithOpaqueID(s string) func(*ScrollRequest) { + return func(r *ScrollRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.search.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.search.go index f84c25fd9..5c00cc7cb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.search.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -295,7 +299,10 @@ func (r SearchRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -743,3 +750,14 @@ func (f Search) WithHeader(h map[string]string) func(*SearchRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Search) WithOpaqueID(s string) func(*SearchRequest) { + return func(r *SearchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.search_shards.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.search_shards.go index ca39a8c5d..f26e53991 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.search_shards.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.search_shards.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -110,7 +114,10 @@ func (r SearchShardsRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -258,3 +265,14 @@ func (f SearchShards) WithHeader(h map[string]string) func(*SearchShardsRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SearchShards) WithOpaqueID(s string) func(*SearchShardsRequest) { + return func(r *SearchShardsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.search_template.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.search_template.go index 9d44d0c1f..451a1ba64 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.search_template.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.search_template.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -151,7 +155,10 @@ func (r SearchTemplateRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -359,3 +366,14 @@ func (f SearchTemplate) WithHeader(h map[string]string) func(*SearchTemplateRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SearchTemplate) WithOpaqueID(s string) func(*SearchTemplateRequest) { + return func(r *SearchTemplateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.create.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.create.go index 775efbfc3..e030a0d56 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.create.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.create.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -95,7 +99,10 @@ func (r SnapshotCreateRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -215,3 +222,14 @@ func (f SnapshotCreate) WithHeader(h map[string]string) func(*SnapshotCreateRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotCreate) WithOpaqueID(s string) func(*SnapshotCreateRequest) { + return func(r *SnapshotCreateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.create_repository.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.create_repository.go index fd962fd2f..a863b0a8a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.create_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.create_repository.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -97,7 +101,10 @@ func (r SnapshotCreateRepositoryRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -217,3 +224,14 @@ func (f SnapshotCreateRepository) WithHeader(h map[string]string) func(*Snapshot } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotCreateRepository) WithOpaqueID(s string) func(*SnapshotCreateRepositoryRequest) { + return func(r *SnapshotCreateRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.delete.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.delete.go index 9e7b6c8cf..a875d1724 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.delete.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -86,7 +90,10 @@ func (r SnapshotDeleteRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -186,3 +193,14 @@ func (f SnapshotDelete) WithHeader(h map[string]string) func(*SnapshotDeleteRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotDelete) WithOpaqueID(s string) func(*SnapshotDeleteRequest) { + return func(r *SnapshotDeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.delete_repository.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.delete_repository.go index b71cd8f32..f028d5641 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.delete_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.delete_repository.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -88,7 +92,10 @@ func (r SnapshotDeleteRepositoryRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -196,3 +203,14 @@ func (f SnapshotDeleteRepository) WithHeader(h map[string]string) func(*Snapshot } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotDeleteRepository) WithOpaqueID(s string) func(*SnapshotDeleteRepositoryRequest) { + return func(r *SnapshotDeleteRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.get.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.get.go index 3004eaf4d..7658e7e81 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.get.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -97,7 +101,10 @@ func (r SnapshotGetRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -213,3 +220,14 @@ func (f SnapshotGet) WithHeader(h map[string]string) func(*SnapshotGetRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotGet) WithOpaqueID(s string) func(*SnapshotGetRequest) { + return func(r *SnapshotGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.get_repository.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.get_repository.go index bab6842bf..7a24b6005 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.get_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.get_repository.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -91,7 +95,10 @@ func (r SnapshotGetRepositoryRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -207,3 +214,14 @@ func (f SnapshotGetRepository) WithHeader(h map[string]string) func(*SnapshotGet } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotGetRepository) WithOpaqueID(s string) func(*SnapshotGetRepositoryRequest) { + return func(r *SnapshotGetRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.restore.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.restore.go index c4ff6887b..4da06c248 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.restore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.restore.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -97,7 +101,10 @@ func (r SnapshotRestoreRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -217,3 +224,14 @@ func (f SnapshotRestore) WithHeader(h map[string]string) func(*SnapshotRestoreRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotRestore) WithOpaqueID(s string) func(*SnapshotRestoreRequest) { + return func(r *SnapshotRestoreRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.status.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.status.go index 6d4a01e52..9d25d9e4a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.status.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -98,7 +102,10 @@ func (r SnapshotStatusRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -222,3 +229,14 @@ func (f SnapshotStatus) WithHeader(h map[string]string) func(*SnapshotStatusRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotStatus) WithOpaqueID(s string) func(*SnapshotStatusRequest) { + return func(r *SnapshotStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.verify_repository.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.verify_repository.go index 00c6a4e65..dc7a3c7a4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.verify_repository.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.snapshot.verify_repository.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -90,7 +94,10 @@ func (r SnapshotVerifyRepositoryRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -198,3 +205,14 @@ func (f SnapshotVerifyRepository) WithHeader(h map[string]string) func(*Snapshot } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SnapshotVerifyRepository) WithOpaqueID(s string) func(*SnapshotVerifyRepositoryRequest) { + return func(r *SnapshotVerifyRepositoryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.tasks.cancel.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.tasks.cancel.go index 13e60b354..5af40c513 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.tasks.cancel.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.tasks.cancel.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -96,7 +100,10 @@ func (r TasksCancelRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -220,3 +227,14 @@ func (f TasksCancel) WithHeader(h map[string]string) func(*TasksCancelRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TasksCancel) WithOpaqueID(s string) func(*TasksCancelRequest) { + return func(r *TasksCancelRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.tasks.get.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.tasks.get.go index 836437434..38b62cc11 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.tasks.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.tasks.get.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -89,7 +93,10 @@ func (r TasksGetRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -197,3 +204,14 @@ func (f TasksGet) WithHeader(h map[string]string) func(*TasksGetRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TasksGet) WithOpaqueID(s string) func(*TasksGetRequest) { + return func(r *TasksGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.tasks.list.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.tasks.list.go index f9c3acfdb..f364d43be 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.tasks.list.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.tasks.list.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -109,7 +113,10 @@ func (r TasksListRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -257,3 +264,14 @@ func (f TasksList) WithHeader(h map[string]string) func(*TasksListRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f TasksList) WithOpaqueID(s string) func(*TasksListRequest) { + return func(r *TasksListRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.termvectors.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.termvectors.go index a666a63b7..dd48778dc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.termvectors.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.termvectors.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -153,7 +157,10 @@ func (r TermvectorsRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -369,3 +376,14 @@ func (f Termvectors) WithHeader(h map[string]string) func(*TermvectorsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Termvectors) WithOpaqueID(s string) func(*TermvectorsRequest) { + return func(r *TermvectorsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.update.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.update.go index c0520dce4..b8c08d67a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.update.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.update.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -167,7 +171,10 @@ func (r UpdateRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -391,3 +398,14 @@ func (f Update) WithHeader(h map[string]string) func(*UpdateRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f Update) WithOpaqueID(s string) func(*UpdateRequest) { + return func(r *UpdateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.update_by_query.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.update_by_query.go index 3db6a3f66..c12b125c5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.update_by_query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.update_by_query.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -258,7 +262,10 @@ func (r UpdateByQueryRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -642,3 +649,14 @@ func (f UpdateByQuery) WithHeader(h map[string]string) func(*UpdateByQueryReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f UpdateByQuery) WithOpaqueID(s string) func(*UpdateByQueryRequest) { + return func(r *UpdateByQueryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.update_by_query_rethrottle.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.update_by_query_rethrottle.go index cc425cd6e..5ba6285e9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.update_by_query_rethrottle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.update_by_query_rethrottle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -85,7 +89,10 @@ func (r UpdateByQueryRethrottleRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -185,3 +192,14 @@ func (f UpdateByQueryRethrottle) WithHeader(h map[string]string) func(*UpdateByQ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f UpdateByQueryRethrottle) WithOpaqueID(s string) func(*UpdateByQueryRethrottleRequest) { + return func(r *UpdateByQueryRethrottleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.delete_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.delete_auto_follow_pattern.go index ac788a47e..6f014c63f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.delete_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.delete_auto_follow_pattern.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -76,7 +80,10 @@ func (r CCRDeleteAutoFollowPatternRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -168,3 +175,14 @@ func (f CCRDeleteAutoFollowPattern) WithHeader(h map[string]string) func(*CCRDel } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRDeleteAutoFollowPattern) WithOpaqueID(s string) func(*CCRDeleteAutoFollowPatternRequest) { + return func(r *CCRDeleteAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.follow.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.follow.go index 984e55fdb..e6b217519 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.follow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.follow.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -85,7 +89,10 @@ func (r CCRFollowRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +196,14 @@ func (f CCRFollow) WithHeader(h map[string]string) func(*CCRFollowRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRFollow) WithOpaqueID(s string) func(*CCRFollowRequest) { + return func(r *CCRFollowRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.follow_info.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.follow_info.go index 4bbd9b175..a144b7c48 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.follow_info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.follow_info.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r CCRFollowInfoRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -178,3 +185,14 @@ func (f CCRFollowInfo) WithHeader(h map[string]string) func(*CCRFollowInfoReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRFollowInfo) WithOpaqueID(s string) func(*CCRFollowInfoRequest) { + return func(r *CCRFollowInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.follow_stats.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.follow_stats.go index 2766563cc..fd458be44 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.follow_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.follow_stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r CCRFollowStatsRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -178,3 +185,14 @@ func (f CCRFollowStats) WithHeader(h map[string]string) func(*CCRFollowStatsRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRFollowStats) WithOpaqueID(s string) func(*CCRFollowStatsRequest) { + return func(r *CCRFollowStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.forget_follower.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.forget_follower.go index 254b50239..74a3944e2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.forget_follower.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.forget_follower.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -79,7 +83,10 @@ func (r CCRForgetFollowerRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -175,3 +182,14 @@ func (f CCRForgetFollower) WithHeader(h map[string]string) func(*CCRForgetFollow } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRForgetFollower) WithOpaqueID(s string) func(*CCRForgetFollowerRequest) { + return func(r *CCRForgetFollowerRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.get_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.get_auto_follow_pattern.go index f6e2bdb24..930998d44 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.get_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.get_auto_follow_pattern.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r CCRGetAutoFollowPatternRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -178,3 +185,14 @@ func (f CCRGetAutoFollowPattern) WithHeader(h map[string]string) func(*CCRGetAut } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRGetAutoFollowPattern) WithOpaqueID(s string) func(*CCRGetAutoFollowPatternRequest) { + return func(r *CCRGetAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.pause_follow.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.pause_follow.go index 5bcf28712..aecfc5aae 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.pause_follow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.pause_follow.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -76,7 +80,10 @@ func (r CCRPauseFollowRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -168,3 +175,14 @@ func (f CCRPauseFollow) WithHeader(h map[string]string) func(*CCRPauseFollowRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRPauseFollow) WithOpaqueID(s string) func(*CCRPauseFollowRequest) { + return func(r *CCRPauseFollowRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.put_auto_follow_pattern.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.put_auto_follow_pattern.go index 4f5891914..cb0256f99 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.put_auto_follow_pattern.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.put_auto_follow_pattern.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -79,7 +83,10 @@ func (r CCRPutAutoFollowPatternRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -175,3 +182,14 @@ func (f CCRPutAutoFollowPattern) WithHeader(h map[string]string) func(*CCRPutAut } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRPutAutoFollowPattern) WithOpaqueID(s string) func(*CCRPutAutoFollowPatternRequest) { + return func(r *CCRPutAutoFollowPatternRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.resume_follow.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.resume_follow.go index 42939bdc2..9c22f6165 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.resume_follow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.resume_follow.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -79,7 +83,10 @@ func (r CCRResumeFollowRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -183,3 +190,14 @@ func (f CCRResumeFollow) WithHeader(h map[string]string) func(*CCRResumeFollowRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRResumeFollow) WithOpaqueID(s string) func(*CCRResumeFollowRequest) { + return func(r *CCRResumeFollowRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.stats.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.stats.go index 3b7df46d9..3ab90b96d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r CCRStatsRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f CCRStats) WithHeader(h map[string]string) func(*CCRStatsRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRStats) WithOpaqueID(s string) func(*CCRStatsRequest) { + return func(r *CCRStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.unfollow.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.unfollow.go index 4166d6298..c34ccbd9c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.unfollow.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ccr.unfollow.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -76,7 +80,10 @@ func (r CCRUnfollowRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -168,3 +175,14 @@ func (f CCRUnfollow) WithHeader(h map[string]string) func(*CCRUnfollowRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f CCRUnfollow) WithOpaqueID(s string) func(*CCRUnfollowRequest) { + return func(r *CCRUnfollowRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.delete_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.delete_lifecycle.go index 57da9c809..f30f04364 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.delete_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.delete_lifecycle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r ILMDeleteLifecycleRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -178,3 +185,14 @@ func (f ILMDeleteLifecycle) WithHeader(h map[string]string) func(*ILMDeleteLifec } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMDeleteLifecycle) WithOpaqueID(s string) func(*ILMDeleteLifecycleRequest) { + return func(r *ILMDeleteLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.explain_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.explain_lifecycle.go index 8c70a9a1f..0ee7feac0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.explain_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.explain_lifecycle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r ILMExplainLifecycleRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -178,3 +185,14 @@ func (f ILMExplainLifecycle) WithHeader(h map[string]string) func(*ILMExplainLif } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMExplainLifecycle) WithOpaqueID(s string) func(*ILMExplainLifecycleRequest) { + return func(r *ILMExplainLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.get_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.get_lifecycle.go index 6f7c81b4f..03fbad519 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.get_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.get_lifecycle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r ILMGetLifecycleRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -178,3 +185,14 @@ func (f ILMGetLifecycle) WithHeader(h map[string]string) func(*ILMGetLifecycleRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMGetLifecycle) WithOpaqueID(s string) func(*ILMGetLifecycleRequest) { + return func(r *ILMGetLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.get_status.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.get_status.go index db0f06c2d..3e74a7c7b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.get_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.get_status.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r ILMGetStatusRequest) Do(ctx context.Context, transport Transport) (*Resp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f ILMGetStatus) WithHeader(h map[string]string) func(*ILMGetStatusRequest) } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMGetStatus) WithOpaqueID(s string) func(*ILMGetStatusRequest) { + return func(r *ILMGetStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.move_to_step.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.move_to_step.go index 6bbf99780..74549af99 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.move_to_step.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.move_to_step.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -81,7 +85,10 @@ func (r ILMMoveToStepRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -193,3 +200,14 @@ func (f ILMMoveToStep) WithHeader(h map[string]string) func(*ILMMoveToStepReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMMoveToStep) WithOpaqueID(s string) func(*ILMMoveToStepRequest) { + return func(r *ILMMoveToStepRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.put_lifecycle.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.put_lifecycle.go index 93956dd3d..a6832ac76 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.put_lifecycle.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.put_lifecycle.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -81,7 +85,10 @@ func (r ILMPutLifecycleRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -193,3 +200,14 @@ func (f ILMPutLifecycle) WithHeader(h map[string]string) func(*ILMPutLifecycleRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMPutLifecycle) WithOpaqueID(s string) func(*ILMPutLifecycleRequest) { + return func(r *ILMPutLifecycleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.remove_policy.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.remove_policy.go index 627d5f81e..e392259fc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.remove_policy.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.remove_policy.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r ILMRemovePolicyRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -178,3 +185,14 @@ func (f ILMRemovePolicy) WithHeader(h map[string]string) func(*ILMRemovePolicyRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMRemovePolicy) WithOpaqueID(s string) func(*ILMRemovePolicyRequest) { + return func(r *ILMRemovePolicyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.retry.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.retry.go index 111ab3aeb..dcb921b39 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.retry.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.retry.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r ILMRetryRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -178,3 +185,14 @@ func (f ILMRetry) WithHeader(h map[string]string) func(*ILMRetryRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMRetry) WithOpaqueID(s string) func(*ILMRetryRequest) { + return func(r *ILMRetryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.start.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.start.go index 74facfb3f..a3dd78203 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.start.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.start.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r ILMStartRequest) Do(ctx context.Context, transport Transport) (*Response params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f ILMStart) WithHeader(h map[string]string) func(*ILMStartRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMStart) WithOpaqueID(s string) func(*ILMStartRequest) { + return func(r *ILMStartRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.stop.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.stop.go index cd1788385..f95a9d5f3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.stop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.ilm.stop.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r ILMStopRequest) Do(ctx context.Context, transport Transport) (*Response, params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f ILMStop) WithHeader(h map[string]string) func(*ILMStopRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f ILMStop) WithOpaqueID(s string) func(*ILMStopRequest) { + return func(r *ILMStopRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.indices.freeze.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.indices.freeze.go index af5d05cb9..67e8b3c9b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.indices.freeze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.indices.freeze.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -107,7 +111,10 @@ func (r IndicesFreezeRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -247,3 +254,14 @@ func (f IndicesFreeze) WithHeader(h map[string]string) func(*IndicesFreezeReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesFreeze) WithOpaqueID(s string) func(*IndicesFreezeRequest) { + return func(r *IndicesFreezeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.indices.unfreeze.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.indices.unfreeze.go index dfbea316a..5573ccc3a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.indices.unfreeze.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.indices.unfreeze.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -107,7 +111,10 @@ func (r IndicesUnfreezeRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -247,3 +254,14 @@ func (f IndicesUnfreeze) WithHeader(h map[string]string) func(*IndicesUnfreezeRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f IndicesUnfreeze) WithOpaqueID(s string) func(*IndicesUnfreezeRequest) { + return func(r *IndicesUnfreezeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.security.create_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.security.create_api_key.go index 1cb37a383..d9b11446d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.security.create_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.security.create_api_key.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r SecurityCreateAPIKeyRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -182,3 +189,14 @@ func (f SecurityCreateAPIKey) WithHeader(h map[string]string) func(*SecurityCrea } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityCreateAPIKey) WithOpaqueID(s string) func(*SecurityCreateAPIKeyRequest) { + return func(r *SecurityCreateAPIKeyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.security.get_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.security.get_api_key.go index e5adc6709..d9e94943f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.security.get_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.security.get_api_key.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -90,7 +94,10 @@ func (r SecurityGetAPIKeyRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -214,3 +221,14 @@ func (f SecurityGetAPIKey) WithHeader(h map[string]string) func(*SecurityGetAPIK } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityGetAPIKey) WithOpaqueID(s string) func(*SecurityGetAPIKeyRequest) { + return func(r *SecurityGetAPIKeyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.security.invalidate_api_key.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.security.invalidate_api_key.go index d2dd7768b..e21180738 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.security.invalidate_api_key.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.security.invalidate_api_key.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -72,7 +76,10 @@ func (r SecurityInvalidateAPIKeyRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -168,3 +175,14 @@ func (f SecurityInvalidateAPIKey) WithHeader(h map[string]string) func(*Security } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f SecurityInvalidateAPIKey) WithOpaqueID(s string) func(*SecurityInvalidateAPIKeyRequest) { + return func(r *SecurityInvalidateAPIKeyRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.graph.explore.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.graph.explore.go index f81e144fa..a583e6e40 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.graph.explore.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.graph.explore.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -100,7 +104,10 @@ func (r XPackGraphExploreRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -236,3 +243,14 @@ func (f XPackGraphExplore) WithHeader(h map[string]string) func(*XPackGraphExplo } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackGraphExplore) WithOpaqueID(s string) func(*XPackGraphExploreRequest) { + return func(r *XPackGraphExploreRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.info.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.info.go index b039a3026..912d7f336 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.info.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -75,7 +79,10 @@ func (r XPackInfoRequest) Do(ctx context.Context, transport Transport) (*Respons params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -175,3 +182,14 @@ func (f XPackInfo) WithHeader(h map[string]string) func(*XPackInfoRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackInfo) WithOpaqueID(s string) func(*XPackInfoRequest) { + return func(r *XPackInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.delete.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.delete.go index 4d8ffe780..b945d44ee 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.delete.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.delete.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r XPackLicenseDeleteRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f XPackLicenseDelete) WithHeader(h map[string]string) func(*XPackLicenseDe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackLicenseDelete) WithOpaqueID(s string) func(*XPackLicenseDeleteRequest) { + return func(r *XPackLicenseDeleteRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.get.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.get.go index 384922945..f74caf1de 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.get.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.get.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -76,7 +80,10 @@ func (r XPackLicenseGetRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -176,3 +183,14 @@ func (f XPackLicenseGet) WithHeader(h map[string]string) func(*XPackLicenseGetRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackLicenseGet) WithOpaqueID(s string) func(*XPackLicenseGetRequest) { + return func(r *XPackLicenseGetRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.get_basic_status.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.get_basic_status.go index 4b82e5947..f2978f743 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.get_basic_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.get_basic_status.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r XPackLicenseGetBasicStatusRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f XPackLicenseGetBasicStatus) WithHeader(h map[string]string) func(*XPackL } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackLicenseGetBasicStatus) WithOpaqueID(s string) func(*XPackLicenseGetBasicStatusRequest) { + return func(r *XPackLicenseGetBasicStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.get_trial_status.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.get_trial_status.go index 62474419b..948acad2c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.get_trial_status.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.get_trial_status.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r XPackLicenseGetTrialStatusRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f XPackLicenseGetTrialStatus) WithHeader(h map[string]string) func(*XPackL } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackLicenseGetTrialStatus) WithOpaqueID(s string) func(*XPackLicenseGetTrialStatusRequest) { + return func(r *XPackLicenseGetTrialStatusRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.post.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.post.go index 5d0a0b4d7..14f412966 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.post.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.post.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -79,7 +83,10 @@ func (r XPackLicensePostRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -191,3 +198,14 @@ func (f XPackLicensePost) WithHeader(h map[string]string) func(*XPackLicensePost } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackLicensePost) WithOpaqueID(s string) func(*XPackLicensePostRequest) { + return func(r *XPackLicensePostRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.post_start_basic.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.post_start_basic.go index 56e54f562..f4581bd9b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.post_start_basic.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.post_start_basic.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -76,7 +80,10 @@ func (r XPackLicensePostStartBasicRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -176,3 +183,14 @@ func (f XPackLicensePostStartBasic) WithHeader(h map[string]string) func(*XPackL } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackLicensePostStartBasic) WithOpaqueID(s string) func(*XPackLicensePostStartBasicRequest) { + return func(r *XPackLicensePostStartBasicRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.post_start_trial.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.post_start_trial.go index bb95e5e5d..3345ba791 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.post_start_trial.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.license.post_start_trial.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -81,7 +85,10 @@ func (r XPackLicensePostStartTrialRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +196,14 @@ func (f XPackLicensePostStartTrial) WithHeader(h map[string]string) func(*XPackL } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackLicensePostStartTrial) WithOpaqueID(s string) func(*XPackLicensePostStartTrialRequest) { + return func(r *XPackLicensePostStartTrialRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.migration.deprecations.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.migration.deprecations.go index f4ed393dc..872f477bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.migration.deprecations.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.migration.deprecations.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -80,7 +84,10 @@ func (r XPackMigrationDeprecationsRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -180,3 +187,14 @@ func (f XPackMigrationDeprecations) WithHeader(h map[string]string) func(*XPackM } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMigrationDeprecations) WithOpaqueID(s string) func(*XPackMigrationDeprecationsRequest) { + return func(r *XPackMigrationDeprecationsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.migration.get_assistance.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.migration.get_assistance.go index f58e36866..6dcc9ce4c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.migration.get_assistance.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.migration.get_assistance.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -97,7 +101,10 @@ func (r XPackMigrationGetAssistanceRequest) Do(ctx context.Context, transport Tr params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -221,3 +228,14 @@ func (f XPackMigrationGetAssistance) WithHeader(h map[string]string) func(*XPack } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMigrationGetAssistance) WithOpaqueID(s string) func(*XPackMigrationGetAssistanceRequest) { + return func(r *XPackMigrationGetAssistanceRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.migration.upgrade.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.migration.upgrade.go index 964419bd2..3ed6989bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.migration.upgrade.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.migration.upgrade.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -85,7 +89,10 @@ func (r XPackMigrationUpgradeRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -185,3 +192,14 @@ func (f XPackMigrationUpgrade) WithHeader(h map[string]string) func(*XPackMigrat } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMigrationUpgrade) WithOpaqueID(s string) func(*XPackMigrationUpgradeRequest) { + return func(r *XPackMigrationUpgradeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.close_job.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.close_job.go index d5440902f..acd848492 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.close_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.close_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -101,7 +105,10 @@ func (r XPackMLCloseJobRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -229,3 +236,14 @@ func (f XPackMLCloseJob) WithHeader(h map[string]string) func(*XPackMLCloseJobRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLCloseJob) WithOpaqueID(s string) func(*XPackMLCloseJobRequest) { + return func(r *XPackMLCloseJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_calendar.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_calendar.go index 3a5c33ae6..a40bf4bd5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_calendar.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_calendar.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r XPackMLDeleteCalendarRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -170,3 +177,14 @@ func (f XPackMLDeleteCalendar) WithHeader(h map[string]string) func(*XPackMLDele } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLDeleteCalendar) WithOpaqueID(s string) func(*XPackMLDeleteCalendarRequest) { + return func(r *XPackMLDeleteCalendarRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_calendar_event.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_calendar_event.go index 16f92d858..bbeeffc7a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_calendar_event.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_calendar_event.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r XPackMLDeleteCalendarEventRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -175,3 +182,14 @@ func (f XPackMLDeleteCalendarEvent) WithHeader(h map[string]string) func(*XPackM } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLDeleteCalendarEvent) WithOpaqueID(s string) func(*XPackMLDeleteCalendarEventRequest) { + return func(r *XPackMLDeleteCalendarEventRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_calendar_job.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_calendar_job.go index 3cb177394..594e77298 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_calendar_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_calendar_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r XPackMLDeleteCalendarJobRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -175,3 +182,14 @@ func (f XPackMLDeleteCalendarJob) WithHeader(h map[string]string) func(*XPackMLD } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLDeleteCalendarJob) WithOpaqueID(s string) func(*XPackMLDeleteCalendarJobRequest) { + return func(r *XPackMLDeleteCalendarJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_datafeed.go index 155a9cd1d..c8e189330 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_datafeed.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -85,7 +89,10 @@ func (r XPackMLDeleteDatafeedRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -185,3 +192,14 @@ func (f XPackMLDeleteDatafeed) WithHeader(h map[string]string) func(*XPackMLDele } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLDeleteDatafeed) WithOpaqueID(s string) func(*XPackMLDeleteDatafeedRequest) { + return func(r *XPackMLDeleteDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_expired_data.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_expired_data.go index 8942ef877..44ef73b39 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_expired_data.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_expired_data.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r XPackMLDeleteExpiredDataRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f XPackMLDeleteExpiredData) WithHeader(h map[string]string) func(*XPackMLD } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLDeleteExpiredData) WithOpaqueID(s string) func(*XPackMLDeleteExpiredDataRequest) { + return func(r *XPackMLDeleteExpiredDataRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_filter.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_filter.go index 84cd846bf..123c662de 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_filter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_filter.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r XPackMLDeleteFilterRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -170,3 +177,14 @@ func (f XPackMLDeleteFilter) WithHeader(h map[string]string) func(*XPackMLDelete } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLDeleteFilter) WithOpaqueID(s string) func(*XPackMLDeleteFilterRequest) { + return func(r *XPackMLDeleteFilterRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_forecast.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_forecast.go index 54b15257a..b55f00477 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_forecast.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_forecast.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -98,7 +102,10 @@ func (r XPackMLDeleteForecastRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -214,3 +221,14 @@ func (f XPackMLDeleteForecast) WithHeader(h map[string]string) func(*XPackMLDele } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLDeleteForecast) WithOpaqueID(s string) func(*XPackMLDeleteForecastRequest) { + return func(r *XPackMLDeleteForecastRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_job.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_job.go index fa6a8acad..6e8cefbf9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -90,7 +94,10 @@ func (r XPackMLDeleteJobRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -198,3 +205,14 @@ func (f XPackMLDeleteJob) WithHeader(h map[string]string) func(*XPackMLDeleteJob } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLDeleteJob) WithOpaqueID(s string) func(*XPackMLDeleteJobRequest) { + return func(r *XPackMLDeleteJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_model_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_model_snapshot.go index fceccb656..641b1bce7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_model_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.delete_model_snapshot.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r XPackMLDeleteModelSnapshotRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -175,3 +182,14 @@ func (f XPackMLDeleteModelSnapshot) WithHeader(h map[string]string) func(*XPackM } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLDeleteModelSnapshot) WithOpaqueID(s string) func(*XPackMLDeleteModelSnapshotRequest) { + return func(r *XPackMLDeleteModelSnapshotRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.find_file_structure.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.find_file_structure.go index fbd5e4c70..62633a0a1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.find_file_structure.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.find_file_structure.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -140,7 +144,10 @@ func (r XPackMLFindFileStructureRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -340,3 +347,14 @@ func (f XPackMLFindFileStructure) WithHeader(h map[string]string) func(*XPackMLF } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLFindFileStructure) WithOpaqueID(s string) func(*XPackMLFindFileStructureRequest) { + return func(r *XPackMLFindFileStructureRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.flush_job.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.flush_job.go index e68ca94e3..68eb0ee4b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.flush_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.flush_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -110,7 +114,10 @@ func (r XPackMLFlushJobRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -254,3 +261,14 @@ func (f XPackMLFlushJob) WithHeader(h map[string]string) func(*XPackMLFlushJobRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLFlushJob) WithOpaqueID(s string) func(*XPackMLFlushJobRequest) { + return func(r *XPackMLFlushJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.forecast.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.forecast.go index 61811cc3e..0b0c63a62 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.forecast.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.forecast.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -92,7 +96,10 @@ func (r XPackMLForecastRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -200,3 +207,14 @@ func (f XPackMLForecast) WithHeader(h map[string]string) func(*XPackMLForecastRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLForecast) WithOpaqueID(s string) func(*XPackMLForecastRequest) { + return func(r *XPackMLForecastRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_buckets.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_buckets.go index df80a9b99..ae7524ad9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_buckets.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_buckets.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -138,7 +142,10 @@ func (r XPackMLGetBucketsRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -322,3 +329,14 @@ func (f XPackMLGetBuckets) WithHeader(h map[string]string) func(*XPackMLGetBucke } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetBuckets) WithOpaqueID(s string) func(*XPackMLGetBucketsRequest) { + return func(r *XPackMLGetBucketsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_calendar_events.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_calendar_events.go index 2706f55fd..8df9c9d9e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_calendar_events.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_calendar_events.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -108,7 +112,10 @@ func (r XPackMLGetCalendarEventsRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -240,3 +247,14 @@ func (f XPackMLGetCalendarEvents) WithHeader(h map[string]string) func(*XPackMLG } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetCalendarEvents) WithOpaqueID(s string) func(*XPackMLGetCalendarEventsRequest) { + return func(r *XPackMLGetCalendarEventsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_calendars.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_calendars.go index a8aa8c759..7f76c8b6a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_calendars.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_calendars.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -92,7 +96,10 @@ func (r XPackMLGetCalendarsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -208,3 +215,14 @@ func (f XPackMLGetCalendars) WithHeader(h map[string]string) func(*XPackMLGetCal } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetCalendars) WithOpaqueID(s string) func(*XPackMLGetCalendarsRequest) { + return func(r *XPackMLGetCalendarsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_categories.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_categories.go index 2ca0fbc22..3bfa8d6ba 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_categories.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_categories.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -104,7 +108,10 @@ func (r XPackMLGetCategoriesRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -232,3 +239,14 @@ func (f XPackMLGetCategories) WithHeader(h map[string]string) func(*XPackMLGetCa } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetCategories) WithOpaqueID(s string) func(*XPackMLGetCategoriesRequest) { + return func(r *XPackMLGetCategoriesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_datafeed_stats.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_datafeed_stats.go index e753347aa..9cf432a08 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_datafeed_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_datafeed_stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -89,7 +93,10 @@ func (r XPackMLGetDatafeedStatsRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -197,3 +204,14 @@ func (f XPackMLGetDatafeedStats) WithHeader(h map[string]string) func(*XPackMLGe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetDatafeedStats) WithOpaqueID(s string) func(*XPackMLGetDatafeedStatsRequest) { + return func(r *XPackMLGetDatafeedStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_datafeeds.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_datafeeds.go index a530a45ae..40dfaefa0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_datafeeds.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_datafeeds.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -87,7 +91,10 @@ func (r XPackMLGetDatafeedsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,3 +202,14 @@ func (f XPackMLGetDatafeeds) WithHeader(h map[string]string) func(*XPackMLGetDat } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetDatafeeds) WithOpaqueID(s string) func(*XPackMLGetDatafeedsRequest) { + return func(r *XPackMLGetDatafeedsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_filters.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_filters.go index 3a3ccc425..819bc60f1 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_filters.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_filters.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -92,7 +96,10 @@ func (r XPackMLGetFiltersRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -208,3 +215,14 @@ func (f XPackMLGetFilters) WithHeader(h map[string]string) func(*XPackMLGetFilte } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetFilters) WithOpaqueID(s string) func(*XPackMLGetFiltersRequest) { + return func(r *XPackMLGetFiltersRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_influencers.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_influencers.go index 40e13a5fa..b7fbe8064 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_influencers.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_influencers.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -128,7 +132,10 @@ func (r XPackMLGetInfluencersRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -296,3 +303,14 @@ func (f XPackMLGetInfluencers) WithHeader(h map[string]string) func(*XPackMLGetI } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetInfluencers) WithOpaqueID(s string) func(*XPackMLGetInfluencersRequest) { + return func(r *XPackMLGetInfluencersRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_job_stats.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_job_stats.go index 8af872457..3a713a95e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_job_stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_job_stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -89,7 +93,10 @@ func (r XPackMLGetJobStatsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -197,3 +204,14 @@ func (f XPackMLGetJobStats) WithHeader(h map[string]string) func(*XPackMLGetJobS } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetJobStats) WithOpaqueID(s string) func(*XPackMLGetJobStatsRequest) { + return func(r *XPackMLGetJobStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_jobs.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_jobs.go index f1302135d..c42648b16 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_jobs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_jobs.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -87,7 +91,10 @@ func (r XPackMLGetJobsRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -195,3 +202,14 @@ func (f XPackMLGetJobs) WithHeader(h map[string]string) func(*XPackMLGetJobsRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetJobs) WithOpaqueID(s string) func(*XPackMLGetJobsRequest) { + return func(r *XPackMLGetJobsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_model_snapshots.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_model_snapshots.go index cbb11beca..4fb8560e3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_model_snapshots.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_model_snapshots.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -121,7 +125,10 @@ func (r XPackMLGetModelSnapshotsRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -281,3 +288,14 @@ func (f XPackMLGetModelSnapshots) WithHeader(h map[string]string) func(*XPackMLG } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetModelSnapshots) WithOpaqueID(s string) func(*XPackMLGetModelSnapshotsRequest) { + return func(r *XPackMLGetModelSnapshotsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_overall_buckets.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_overall_buckets.go index 80049c1c1..b21798d56 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_overall_buckets.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_overall_buckets.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -123,7 +127,10 @@ func (r XPackMLGetOverallBucketsRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -283,3 +290,14 @@ func (f XPackMLGetOverallBuckets) WithHeader(h map[string]string) func(*XPackMLG } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetOverallBuckets) WithOpaqueID(s string) func(*XPackMLGetOverallBucketsRequest) { + return func(r *XPackMLGetOverallBucketsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_records.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_records.go index 0a3ae6d06..fe0b6e0a0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_records.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.get_records.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -128,7 +132,10 @@ func (r XPackMLGetRecordsRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -296,3 +303,14 @@ func (f XPackMLGetRecords) WithHeader(h map[string]string) func(*XPackMLGetRecor } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLGetRecords) WithOpaqueID(s string) func(*XPackMLGetRecordsRequest) { + return func(r *XPackMLGetRecordsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.info.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.info.go index ca3bad7c8..45f5b1042 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.info.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.info.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r XPackMLInfoRequest) Do(ctx context.Context, transport Transport) (*Respo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f XPackMLInfo) WithHeader(h map[string]string) func(*XPackMLInfoRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLInfo) WithOpaqueID(s string) func(*XPackMLInfoRequest) { + return func(r *XPackMLInfoRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.open_job.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.open_job.go index c286dfc94..9b0681cf2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.open_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.open_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r XPackMLOpenJobRequest) Do(ctx context.Context, transport Transport) (*Re params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -191,3 +198,14 @@ func (f XPackMLOpenJob) WithHeader(h map[string]string) func(*XPackMLOpenJobRequ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLOpenJob) WithOpaqueID(s string) func(*XPackMLOpenJobRequest) { + return func(r *XPackMLOpenJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.post_calendar_events.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.post_calendar_events.go index 92a4c0a89..1da990843 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.post_calendar_events.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.post_calendar_events.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r XPackMLPostCalendarEventsRequest) Do(ctx context.Context, transport Tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -179,3 +186,14 @@ func (f XPackMLPostCalendarEvents) WithHeader(h map[string]string) func(*XPackML } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLPostCalendarEvents) WithOpaqueID(s string) func(*XPackMLPostCalendarEventsRequest) { + return func(r *XPackMLPostCalendarEventsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.post_data.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.post_data.go index e2e8c3942..68b754862 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.post_data.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.post_data.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -94,7 +98,10 @@ func (r XPackMLPostDataRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -206,3 +213,14 @@ func (f XPackMLPostData) WithHeader(h map[string]string) func(*XPackMLPostDataRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLPostData) WithOpaqueID(s string) func(*XPackMLPostDataRequest) { + return func(r *XPackMLPostDataRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.preview_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.preview_datafeed.go index 25cbaa5f8..3fd1d1896 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.preview_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.preview_datafeed.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -80,7 +84,10 @@ func (r XPackMLPreviewDatafeedRequest) Do(ctx context.Context, transport Transpo params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -172,3 +179,14 @@ func (f XPackMLPreviewDatafeed) WithHeader(h map[string]string) func(*XPackMLPre } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLPreviewDatafeed) WithOpaqueID(s string) func(*XPackMLPreviewDatafeedRequest) { + return func(r *XPackMLPreviewDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_calendar.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_calendar.go index 630a72cf7..7fc7bc9e0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_calendar.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_calendar.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -81,7 +85,10 @@ func (r XPackMLPutCalendarRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -185,3 +192,14 @@ func (f XPackMLPutCalendar) WithHeader(h map[string]string) func(*XPackMLPutCale } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLPutCalendar) WithOpaqueID(s string) func(*XPackMLPutCalendarRequest) { + return func(r *XPackMLPutCalendarRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_calendar_job.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_calendar_job.go index 7ac1bd79b..0015559c8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_calendar_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_calendar_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r XPackMLPutCalendarJobRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -175,3 +182,14 @@ func (f XPackMLPutCalendarJob) WithHeader(h map[string]string) func(*XPackMLPutC } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLPutCalendarJob) WithOpaqueID(s string) func(*XPackMLPutCalendarJobRequest) { + return func(r *XPackMLPutCalendarJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_datafeed.go index e169550da..474865839 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_datafeed.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -81,7 +85,10 @@ func (r XPackMLPutDatafeedRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -177,3 +184,14 @@ func (f XPackMLPutDatafeed) WithHeader(h map[string]string) func(*XPackMLPutData } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLPutDatafeed) WithOpaqueID(s string) func(*XPackMLPutDatafeedRequest) { + return func(r *XPackMLPutDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_filter.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_filter.go index b461225d1..f29acb000 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_filter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_filter.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -81,7 +85,10 @@ func (r XPackMLPutFilterRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -177,3 +184,14 @@ func (f XPackMLPutFilter) WithHeader(h map[string]string) func(*XPackMLPutFilter } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLPutFilter) WithOpaqueID(s string) func(*XPackMLPutFilterRequest) { + return func(r *XPackMLPutFilterRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_job.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_job.go index f8b83495f..b7f33f945 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.put_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -81,7 +85,10 @@ func (r XPackMLPutJobRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -177,3 +184,14 @@ func (f XPackMLPutJob) WithHeader(h map[string]string) func(*XPackMLPutJobReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLPutJob) WithOpaqueID(s string) func(*XPackMLPutJobRequest) { + return func(r *XPackMLPutJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.revert_model_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.revert_model_snapshot.go index b2558637f..6c22dc82b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.revert_model_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.revert_model_snapshot.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -95,7 +99,10 @@ func (r XPackMLRevertModelSnapshotRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -207,3 +214,14 @@ func (f XPackMLRevertModelSnapshot) WithHeader(h map[string]string) func(*XPackM } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLRevertModelSnapshot) WithOpaqueID(s string) func(*XPackMLRevertModelSnapshotRequest) { + return func(r *XPackMLRevertModelSnapshotRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.set_upgrade_mode.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.set_upgrade_mode.go index 1abbb0729..2ca75df66 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.set_upgrade_mode.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.set_upgrade_mode.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -82,7 +86,10 @@ func (r XPackMLSetUpgradeModeRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -190,3 +197,14 @@ func (f XPackMLSetUpgradeMode) WithHeader(h map[string]string) func(*XPackMLSetU } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLSetUpgradeMode) WithOpaqueID(s string) func(*XPackMLSetUpgradeModeRequest) { + return func(r *XPackMLSetUpgradeModeRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.start_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.start_datafeed.go index 417133c12..5410f19ab 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.start_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.start_datafeed.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -100,7 +104,10 @@ func (r XPackMLStartDatafeedRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -228,3 +235,14 @@ func (f XPackMLStartDatafeed) WithHeader(h map[string]string) func(*XPackMLStart } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLStartDatafeed) WithOpaqueID(s string) func(*XPackMLStartDatafeedRequest) { + return func(r *XPackMLStartDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.stop_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.stop_datafeed.go index 2a78e7f26..1fbfaa902 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.stop_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.stop_datafeed.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -98,7 +102,10 @@ func (r XPackMLStopDatafeedRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -214,3 +221,14 @@ func (f XPackMLStopDatafeed) WithHeader(h map[string]string) func(*XPackMLStopDa } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLStopDatafeed) WithOpaqueID(s string) func(*XPackMLStopDatafeedRequest) { + return func(r *XPackMLStopDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_datafeed.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_datafeed.go index a4741591b..9e9379ade 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_datafeed.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_datafeed.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r XPackMLUpdateDatafeedRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -179,3 +186,14 @@ func (f XPackMLUpdateDatafeed) WithHeader(h map[string]string) func(*XPackMLUpda } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLUpdateDatafeed) WithOpaqueID(s string) func(*XPackMLUpdateDatafeedRequest) { + return func(r *XPackMLUpdateDatafeedRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_filter.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_filter.go index 9c869471c..e39f6d81a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_filter.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_filter.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r XPackMLUpdateFilterRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -179,3 +186,14 @@ func (f XPackMLUpdateFilter) WithHeader(h map[string]string) func(*XPackMLUpdate } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLUpdateFilter) WithOpaqueID(s string) func(*XPackMLUpdateFilterRequest) { + return func(r *XPackMLUpdateFilterRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_job.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_job.go index 2c67fbc44..42c772b9d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -83,7 +87,10 @@ func (r XPackMLUpdateJobRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -179,3 +186,14 @@ func (f XPackMLUpdateJob) WithHeader(h map[string]string) func(*XPackMLUpdateJob } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLUpdateJob) WithOpaqueID(s string) func(*XPackMLUpdateJobRequest) { + return func(r *XPackMLUpdateJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_model_snapshot.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_model_snapshot.go index af14d40e6..7fde7557d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_model_snapshot.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.update_model_snapshot.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -88,7 +92,10 @@ func (r XPackMLUpdateModelSnapshotRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -184,3 +191,14 @@ func (f XPackMLUpdateModelSnapshot) WithHeader(h map[string]string) func(*XPackM } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLUpdateModelSnapshot) WithOpaqueID(s string) func(*XPackMLUpdateModelSnapshotRequest) { + return func(r *XPackMLUpdateModelSnapshotRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.validate.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.validate.go index 4e14be5f4..6d3d9d9ad 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.validate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.validate.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -72,7 +76,10 @@ func (r XPackMLValidateRequest) Do(ctx context.Context, transport Transport) (*R params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -168,3 +175,14 @@ func (f XPackMLValidate) WithHeader(h map[string]string) func(*XPackMLValidateRe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLValidate) WithOpaqueID(s string) func(*XPackMLValidateRequest) { + return func(r *XPackMLValidateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.validate_detector.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.validate_detector.go index 109f8fcf0..684777394 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.validate_detector.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ml.validate_detector.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -72,7 +76,10 @@ func (r XPackMLValidateDetectorRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -168,3 +175,14 @@ func (f XPackMLValidateDetector) WithHeader(h map[string]string) func(*XPackMLVa } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMLValidateDetector) WithOpaqueID(s string) func(*XPackMLValidateDetectorRequest) { + return func(r *XPackMLValidateDetectorRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.monitoring.bulk.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.monitoring.bulk.go index 426ea44a2..5a56f903e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.monitoring.bulk.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.monitoring.bulk.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -99,7 +103,10 @@ func (r XPackMonitoringBulkRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -227,3 +234,14 @@ func (f XPackMonitoringBulk) WithHeader(h map[string]string) func(*XPackMonitori } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackMonitoringBulk) WithOpaqueID(s string) func(*XPackMonitoringBulkRequest) { + return func(r *XPackMonitoringBulkRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.delete_job.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.delete_job.go index 7bc51d029..5125fe29d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.delete_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.delete_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r XPackRollupDeleteJobRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -170,3 +177,14 @@ func (f XPackRollupDeleteJob) WithHeader(h map[string]string) func(*XPackRollupD } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackRollupDeleteJob) WithOpaqueID(s string) func(*XPackRollupDeleteJobRequest) { + return func(r *XPackRollupDeleteJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.get_jobs.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.get_jobs.go index c1e63a3b2..64f906561 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.get_jobs.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.get_jobs.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -80,7 +84,10 @@ func (r XPackRollupGetJobsRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -180,3 +187,14 @@ func (f XPackRollupGetJobs) WithHeader(h map[string]string) func(*XPackRollupGet } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackRollupGetJobs) WithOpaqueID(s string) func(*XPackRollupGetJobsRequest) { + return func(r *XPackRollupGetJobsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.get_rollup_caps.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.get_rollup_caps.go index a117f44ad..b450d6434 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.get_rollup_caps.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.get_rollup_caps.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -80,7 +84,10 @@ func (r XPackRollupGetRollupCapsRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -180,3 +187,14 @@ func (f XPackRollupGetRollupCaps) WithHeader(h map[string]string) func(*XPackRol } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackRollupGetRollupCaps) WithOpaqueID(s string) func(*XPackRollupGetRollupCapsRequest) { + return func(r *XPackRollupGetRollupCapsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.get_rollup_index_caps.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.get_rollup_index_caps.go index c29f6329b..5f08e47d3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.get_rollup_index_caps.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.get_rollup_index_caps.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r XPackRollupGetRollupIndexCapsRequest) Do(ctx context.Context, transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -170,3 +177,14 @@ func (f XPackRollupGetRollupIndexCaps) WithHeader(h map[string]string) func(*XPa } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackRollupGetRollupIndexCaps) WithOpaqueID(s string) func(*XPackRollupGetRollupIndexCapsRequest) { + return func(r *XPackRollupGetRollupIndexCapsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.put_job.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.put_job.go index 5c7ddc66f..596902672 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.put_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.put_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -81,7 +85,10 @@ func (r XPackRollupPutJobRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -177,3 +184,14 @@ func (f XPackRollupPutJob) WithHeader(h map[string]string) func(*XPackRollupPutJ } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackRollupPutJob) WithOpaqueID(s string) func(*XPackRollupPutJobRequest) { + return func(r *XPackRollupPutJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.rollup_search.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.rollup_search.go index 7fcef1560..48248edf7 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.rollup_search.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.rollup_search.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -89,7 +93,10 @@ func (r XPackRollupRollupSearchRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -201,3 +208,14 @@ func (f XPackRollupRollupSearch) WithHeader(h map[string]string) func(*XPackRoll } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackRollupRollupSearch) WithOpaqueID(s string) func(*XPackRollupRollupSearchRequest) { + return func(r *XPackRollupRollupSearchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.start_job.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.start_job.go index fbea45403..76b7efc7a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.start_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.start_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -80,7 +84,10 @@ func (r XPackRollupStartJobRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -172,3 +179,14 @@ func (f XPackRollupStartJob) WithHeader(h map[string]string) func(*XPackRollupSt } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackRollupStartJob) WithOpaqueID(s string) func(*XPackRollupStartJobRequest) { + return func(r *XPackRollupStartJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.stop_job.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.stop_job.go index 6e1686d2a..263c777d3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.stop_job.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.rollup.stop_job.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -93,7 +97,10 @@ func (r XPackRollupStopJobRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -201,3 +208,14 @@ func (f XPackRollupStopJob) WithHeader(h map[string]string) func(*XPackRollupSto } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackRollupStopJob) WithOpaqueID(s string) func(*XPackRollupStopJobRequest) { + return func(r *XPackRollupStopJobRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.authenticate.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.authenticate.go index ddec908c3..10bc2d880 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.authenticate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.authenticate.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r XPackSecurityAuthenticateRequest) Do(ctx context.Context, transport Tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f XPackSecurityAuthenticate) WithHeader(h map[string]string) func(*XPackSe } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityAuthenticate) WithOpaqueID(s string) func(*XPackSecurityAuthenticateRequest) { + return func(r *XPackSecurityAuthenticateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.change_password.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.change_password.go index a9e0a5bf5..e1144e179 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.change_password.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.change_password.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -91,7 +95,10 @@ func (r XPackSecurityChangePasswordRequest) Do(ctx context.Context, transport Tr params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -203,3 +210,14 @@ func (f XPackSecurityChangePassword) WithHeader(h map[string]string) func(*XPack } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityChangePassword) WithOpaqueID(s string) func(*XPackSecurityChangePasswordRequest) { + return func(r *XPackSecurityChangePasswordRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.clear_cached_realms.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.clear_cached_realms.go index 02359847e..4ce633270 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.clear_cached_realms.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.clear_cached_realms.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -86,7 +90,10 @@ func (r XPackSecurityClearCachedRealmsRequest) Do(ctx context.Context, transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -186,3 +193,14 @@ func (f XPackSecurityClearCachedRealms) WithHeader(h map[string]string) func(*XP } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityClearCachedRealms) WithOpaqueID(s string) func(*XPackSecurityClearCachedRealmsRequest) { + return func(r *XPackSecurityClearCachedRealmsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.clear_cached_roles.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.clear_cached_roles.go index 9884ca9c7..bb485c9c5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.clear_cached_roles.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.clear_cached_roles.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -80,7 +84,10 @@ func (r XPackSecurityClearCachedRolesRequest) Do(ctx context.Context, transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -172,3 +179,14 @@ func (f XPackSecurityClearCachedRoles) WithHeader(h map[string]string) func(*XPa } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityClearCachedRoles) WithOpaqueID(s string) func(*XPackSecurityClearCachedRolesRequest) { + return func(r *XPackSecurityClearCachedRolesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_privileges.go index 82fc2b6f1..24613c005 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_privileges.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -87,7 +91,10 @@ func (r XPackSecurityDeletePrivilegesRequest) Do(ctx context.Context, transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -187,3 +194,14 @@ func (f XPackSecurityDeletePrivileges) WithHeader(h map[string]string) func(*XPa } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityDeletePrivileges) WithOpaqueID(s string) func(*XPackSecurityDeletePrivilegesRequest) { + return func(r *XPackSecurityDeletePrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_role.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_role.go index 301e746c2..a552fd9fc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_role.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -84,7 +88,10 @@ func (r XPackSecurityDeleteRoleRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -184,3 +191,14 @@ func (f XPackSecurityDeleteRole) WithHeader(h map[string]string) func(*XPackSecu } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityDeleteRole) WithOpaqueID(s string) func(*XPackSecurityDeleteRoleRequest) { + return func(r *XPackSecurityDeleteRoleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_role_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_role_mapping.go index 4151369e1..d270b1206 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_role_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_role_mapping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -84,7 +88,10 @@ func (r XPackSecurityDeleteRoleMappingRequest) Do(ctx context.Context, transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -184,3 +191,14 @@ func (f XPackSecurityDeleteRoleMapping) WithHeader(h map[string]string) func(*XP } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityDeleteRoleMapping) WithOpaqueID(s string) func(*XPackSecurityDeleteRoleMappingRequest) { + return func(r *XPackSecurityDeleteRoleMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_user.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_user.go index 411ba00bf..3b0b54d93 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.delete_user.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -84,7 +88,10 @@ func (r XPackSecurityDeleteUserRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -184,3 +191,14 @@ func (f XPackSecurityDeleteUser) WithHeader(h map[string]string) func(*XPackSecu } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityDeleteUser) WithOpaqueID(s string) func(*XPackSecurityDeleteUserRequest) { + return func(r *XPackSecurityDeleteUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.disable_user.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.disable_user.go index 1c87cea2b..799cf6414 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.disable_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.disable_user.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -86,7 +90,10 @@ func (r XPackSecurityDisableUserRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -186,3 +193,14 @@ func (f XPackSecurityDisableUser) WithHeader(h map[string]string) func(*XPackSec } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityDisableUser) WithOpaqueID(s string) func(*XPackSecurityDisableUserRequest) { + return func(r *XPackSecurityDisableUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.enable_user.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.enable_user.go index 2e94177ee..255bef190 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.enable_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.enable_user.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -86,7 +90,10 @@ func (r XPackSecurityEnableUserRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -186,3 +193,14 @@ func (f XPackSecurityEnableUser) WithHeader(h map[string]string) func(*XPackSecu } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityEnableUser) WithOpaqueID(s string) func(*XPackSecurityEnableUserRequest) { + return func(r *XPackSecurityEnableUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_privileges.go index d2c07e78b..7941c29a3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_privileges.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -85,7 +89,10 @@ func (r XPackSecurityGetPrivilegesRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -193,3 +200,14 @@ func (f XPackSecurityGetPrivileges) WithHeader(h map[string]string) func(*XPackS } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityGetPrivileges) WithOpaqueID(s string) func(*XPackSecurityGetPrivilegesRequest) { + return func(r *XPackSecurityGetPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_role.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_role.go index d22def5df..d45b6641c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_role.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -80,7 +84,10 @@ func (r XPackSecurityGetRoleRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -180,3 +187,14 @@ func (f XPackSecurityGetRole) WithHeader(h map[string]string) func(*XPackSecurit } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityGetRole) WithOpaqueID(s string) func(*XPackSecurityGetRoleRequest) { + return func(r *XPackSecurityGetRoleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_role_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_role_mapping.go index 2427faaea..25ed9f8f9 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_role_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_role_mapping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -80,7 +84,10 @@ func (r XPackSecurityGetRoleMappingRequest) Do(ctx context.Context, transport Tr params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -180,3 +187,14 @@ func (f XPackSecurityGetRoleMapping) WithHeader(h map[string]string) func(*XPack } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityGetRoleMapping) WithOpaqueID(s string) func(*XPackSecurityGetRoleMappingRequest) { + return func(r *XPackSecurityGetRoleMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_token.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_token.go index aa6ca328c..83a8f7a1d 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_token.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -72,7 +76,10 @@ func (r XPackSecurityGetTokenRequest) Do(ctx context.Context, transport Transpor params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -168,3 +175,14 @@ func (f XPackSecurityGetToken) WithHeader(h map[string]string) func(*XPackSecuri } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityGetToken) WithOpaqueID(s string) func(*XPackSecurityGetTokenRequest) { + return func(r *XPackSecurityGetTokenRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_user.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_user.go index 4414a4e82..409997fe2 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_user.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -80,7 +84,10 @@ func (r XPackSecurityGetUserRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -180,3 +187,14 @@ func (f XPackSecurityGetUser) WithHeader(h map[string]string) func(*XPackSecurit } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityGetUser) WithOpaqueID(s string) func(*XPackSecurityGetUserRequest) { + return func(r *XPackSecurityGetUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_user_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_user_privileges.go index ddbb07076..cbf580d57 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_user_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.get_user_privileges.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r XPackSecurityGetUserPrivilegesRequest) Do(ctx context.Context, transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f XPackSecurityGetUserPrivileges) WithHeader(h map[string]string) func(*XP } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityGetUserPrivileges) WithOpaqueID(s string) func(*XPackSecurityGetUserPrivilegesRequest) { + return func(r *XPackSecurityGetUserPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.has_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.has_privileges.go index 2ae93f45d..89fe0414c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.has_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.has_privileges.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -85,7 +89,10 @@ func (r XPackSecurityHasPrivilegesRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -189,3 +196,14 @@ func (f XPackSecurityHasPrivileges) WithHeader(h map[string]string) func(*XPackS } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityHasPrivileges) WithOpaqueID(s string) func(*XPackSecurityHasPrivilegesRequest) { + return func(r *XPackSecurityHasPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.invalidate_token.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.invalidate_token.go index 7cee86c9a..128488eaa 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.invalidate_token.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.invalidate_token.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -72,7 +76,10 @@ func (r XPackSecurityInvalidateTokenRequest) Do(ctx context.Context, transport T params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -168,3 +175,14 @@ func (f XPackSecurityInvalidateToken) WithHeader(h map[string]string) func(*XPac } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityInvalidateToken) WithOpaqueID(s string) func(*XPackSecurityInvalidateTokenRequest) { + return func(r *XPackSecurityInvalidateTokenRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_privileges.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_privileges.go index ff38fdffb..45aeb8b02 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_privileges.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_privileges.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r XPackSecurityPutPrivilegesRequest) Do(ctx context.Context, transport Tra params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -182,3 +189,14 @@ func (f XPackSecurityPutPrivileges) WithHeader(h map[string]string) func(*XPackS } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityPutPrivileges) WithOpaqueID(s string) func(*XPackSecurityPutPrivilegesRequest) { + return func(r *XPackSecurityPutPrivilegesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_role.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_role.go index 3120bc7fb..098821d07 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_role.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_role.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -87,7 +91,10 @@ func (r XPackSecurityPutRoleRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -191,3 +198,14 @@ func (f XPackSecurityPutRole) WithHeader(h map[string]string) func(*XPackSecurit } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityPutRole) WithOpaqueID(s string) func(*XPackSecurityPutRoleRequest) { + return func(r *XPackSecurityPutRoleRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_role_mapping.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_role_mapping.go index 4a2f9f29c..09524e6e4 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_role_mapping.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_role_mapping.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -87,7 +91,10 @@ func (r XPackSecurityPutRoleMappingRequest) Do(ctx context.Context, transport Tr params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -191,3 +198,14 @@ func (f XPackSecurityPutRoleMapping) WithHeader(h map[string]string) func(*XPack } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityPutRoleMapping) WithOpaqueID(s string) func(*XPackSecurityPutRoleMappingRequest) { + return func(r *XPackSecurityPutRoleMappingRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_user.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_user.go index 0cb68cd08..468ac673e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_user.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.security.put_user.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -87,7 +91,10 @@ func (r XPackSecurityPutUserRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -191,3 +198,14 @@ func (f XPackSecurityPutUser) WithHeader(h map[string]string) func(*XPackSecurit } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSecurityPutUser) WithOpaqueID(s string) func(*XPackSecurityPutUserRequest) { + return func(r *XPackSecurityPutUserRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.sql.clear_cursor.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.sql.clear_cursor.go index ac432ce6f..7f38b6c1f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.sql.clear_cursor.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.sql.clear_cursor.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -72,7 +76,10 @@ func (r XPackSQLClearCursorRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -168,3 +175,14 @@ func (f XPackSQLClearCursor) WithHeader(h map[string]string) func(*XPackSQLClear } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSQLClearCursor) WithOpaqueID(s string) func(*XPackSQLClearCursorRequest) { + return func(r *XPackSQLClearCursorRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.sql.query.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.sql.query.go index c7c147720..422289335 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.sql.query.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.sql.query.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r XPackSQLQueryRequest) Do(ctx context.Context, transport Transport) (*Res params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -182,3 +189,14 @@ func (f XPackSQLQuery) WithHeader(h map[string]string) func(*XPackSQLQueryReques } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSQLQuery) WithOpaqueID(s string) func(*XPackSQLQueryRequest) { + return func(r *XPackSQLQueryRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.sql.translate.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.sql.translate.go index 8dbda7644..097b40b3a 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.sql.translate.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.sql.translate.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -72,7 +76,10 @@ func (r XPackSQLTranslateRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -168,3 +175,14 @@ func (f XPackSQLTranslate) WithHeader(h map[string]string) func(*XPackSQLTransla } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSQLTranslate) WithOpaqueID(s string) func(*XPackSQLTranslateRequest) { + return func(r *XPackSQLTranslateRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ssl.certificates.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ssl.certificates.go index 57830b9ef..4e2f3d2f5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ssl.certificates.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.ssl.certificates.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r XPackSSLCertificatesRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f XPackSSLCertificates) WithHeader(h map[string]string) func(*XPackSSLCert } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackSSLCertificates) WithOpaqueID(s string) func(*XPackSSLCertificatesRequest) { + return func(r *XPackSSLCertificatesRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.usage.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.usage.go index bfc673b84..81b25d94f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.usage.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.usage.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -76,7 +80,10 @@ func (r XPackUsageRequest) Do(ctx context.Context, transport Transport) (*Respon params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -176,3 +183,14 @@ func (f XPackUsage) WithHeader(h map[string]string) func(*XPackUsageRequest) { } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackUsage) WithOpaqueID(s string) func(*XPackUsageRequest) { + return func(r *XPackUsageRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.ack_watch.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.ack_watch.go index c76200bf9..4c2744707 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.ack_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.ack_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -92,7 +96,10 @@ func (r XPackWatcherAckWatchRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -200,3 +207,14 @@ func (f XPackWatcherAckWatch) WithHeader(h map[string]string) func(*XPackWatcher } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackWatcherAckWatch) WithOpaqueID(s string) func(*XPackWatcherAckWatchRequest) { + return func(r *XPackWatcherAckWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.activate_watch.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.activate_watch.go index ac70353d7..690b239b0 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.activate_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.activate_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -87,7 +91,10 @@ func (r XPackWatcherActivateWatchRequest) Do(ctx context.Context, transport Tran params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -187,3 +194,14 @@ func (f XPackWatcherActivateWatch) WithHeader(h map[string]string) func(*XPackWa } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackWatcherActivateWatch) WithOpaqueID(s string) func(*XPackWatcherActivateWatchRequest) { + return func(r *XPackWatcherActivateWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.deactivate_watch.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.deactivate_watch.go index ea75f4455..d0a7ce506 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.deactivate_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.deactivate_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -87,7 +91,10 @@ func (r XPackWatcherDeactivateWatchRequest) Do(ctx context.Context, transport Tr params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -187,3 +194,14 @@ func (f XPackWatcherDeactivateWatch) WithHeader(h map[string]string) func(*XPack } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackWatcherDeactivateWatch) WithOpaqueID(s string) func(*XPackWatcherDeactivateWatchRequest) { + return func(r *XPackWatcherDeactivateWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.delete_watch.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.delete_watch.go index 02a10c7e8..feff97008 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.delete_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.delete_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -85,7 +89,10 @@ func (r XPackWatcherDeleteWatchRequest) Do(ctx context.Context, transport Transp params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -185,3 +192,14 @@ func (f XPackWatcherDeleteWatch) WithHeader(h map[string]string) func(*XPackWatc } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackWatcherDeleteWatch) WithOpaqueID(s string) func(*XPackWatcherDeleteWatchRequest) { + return func(r *XPackWatcherDeleteWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.execute_watch.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.execute_watch.go index a5636ecc3..5e198a6e5 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.execute_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.execute_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -92,7 +96,10 @@ func (r XPackWatcherExecuteWatchRequest) Do(ctx context.Context, transport Trans params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -212,3 +219,14 @@ func (f XPackWatcherExecuteWatch) WithHeader(h map[string]string) func(*XPackWat } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackWatcherExecuteWatch) WithOpaqueID(s string) func(*XPackWatcherExecuteWatchRequest) { + return func(r *XPackWatcherExecuteWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.get_watch.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.get_watch.go index 12973e417..f0f1a837c 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.get_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.get_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -78,7 +82,10 @@ func (r XPackWatcherGetWatchRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -170,3 +177,14 @@ func (f XPackWatcherGetWatch) WithHeader(h map[string]string) func(*XPackWatcher } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackWatcherGetWatch) WithOpaqueID(s string) func(*XPackWatcherGetWatchRequest) { + return func(r *XPackWatcherGetWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.put_watch.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.put_watch.go index a6556e47f..ffb799f2e 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.put_watch.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.put_watch.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -109,7 +113,10 @@ func (r XPackWatcherPutWatchRequest) Do(ctx context.Context, transport Transport params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), r.Body) + req, err := newRequest(method, path.String(), r.Body) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -253,3 +260,14 @@ func (f XPackWatcherPutWatch) WithHeader(h map[string]string) func(*XPackWatcher } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackWatcherPutWatch) WithOpaqueID(s string) func(*XPackWatcherPutWatchRequest) { + return func(r *XPackWatcherPutWatchRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.restart.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.restart.go index a7a2068cf..e190273c6 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.restart.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.restart.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r XPackWatcherRestartRequest) Do(ctx context.Context, transport Transport) params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f XPackWatcherRestart) WithHeader(h map[string]string) func(*XPackWatcherR } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackWatcherRestart) WithOpaqueID(s string) func(*XPackWatcherRestartRequest) { + return func(r *XPackWatcherRestartRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.start.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.start.go index 48e45c985..2bf9074bc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.start.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.start.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r XPackWatcherStartRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f XPackWatcherStart) WithHeader(h map[string]string) func(*XPackWatcherSta } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackWatcherStart) WithOpaqueID(s string) func(*XPackWatcherStartRequest) { + return func(r *XPackWatcherStartRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.stats.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.stats.go index ce19cc823..360da2271 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.stats.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.stats.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -91,7 +95,10 @@ func (r XPackWatcherStatsRequest) Do(ctx context.Context, transport Transport) ( params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -199,3 +206,14 @@ func (f XPackWatcherStats) WithHeader(h map[string]string) func(*XPackWatcherSta } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackWatcherStats) WithOpaqueID(s string) func(*XPackWatcherStatsRequest) { + return func(r *XPackWatcherStatsRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.stop.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.stop.go index ed82566bd..d381be539 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.stop.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/api.xpack.xpack.watcher.stop.go @@ -1,4 +1,8 @@ -// Code generated from specification version 6.8.2: DO NOT EDIT +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// Code generated from specification version 6.8.8: DO NOT EDIT package esapi @@ -69,7 +73,10 @@ func (r XPackWatcherStopRequest) Do(ctx context.Context, transport Transport) (* params["filter_path"] = strings.Join(r.FilterPath, ",") } - req, _ := newRequest(method, path.String(), nil) + req, err := newRequest(method, path.String(), nil) + if err != nil { + return nil, err + } if len(params) > 0 { q := req.URL.Query() @@ -161,3 +168,14 @@ func (f XPackWatcherStop) WithHeader(h map[string]string) func(*XPackWatcherStop } } } + +// WithOpaqueID adds the X-Opaque-Id header to the HTTP request. +// +func (f XPackWatcherStop) WithOpaqueID(s string) func(*XPackWatcherStopRequest) { + return func(r *XPackWatcherStopRequest) { + if r.Header == nil { + r.Header = make(http.Header) + } + r.Header.Set("X-Opaque-Id", s) + } +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/doc.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/doc.go index 03afa5c05..fc210c0fc 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/doc.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/doc.go @@ -85,10 +85,11 @@ about the API endpoints and parameters. The Go API is generated from the Elasticsearch JSON specification at https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/api by the internal package available at -https://github.com/elastic/go-elasticsearch/tree/master/internal/cmd/generate/commands. +https://github.com/elastic/go-elasticsearch/tree/master/internal/cmd/generate/commands/gensource. The API is tested by integration tests common to all Elasticsearch official clients, generated from the -source at https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/test. The generator is provided by the internal package internal/cmd/generate. +source at https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/test. +The generator is provided by the internal package available at internal/cmd/generate/commands/gentests. */ package esapi diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/esapi.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/esapi.go index 9ae30f2ed..4ac06307b 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/esapi.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/esapi.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package esapi import ( diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/esapi.request.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/esapi.request.go index dbdf517eb..d967fc61f 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/esapi.request.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/esapi.request.go @@ -1,13 +1,13 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package esapi import ( - "bytes" "context" "io" - "io/ioutil" "net/http" - "net/url" - "strings" ) const ( @@ -27,30 +27,5 @@ type Request interface { // newRequest creates an HTTP request. // func newRequest(method, path string, body io.Reader) (*http.Request, error) { - r := http.Request{ - Method: method, - URL: &url.URL{Path: path}, - Proto: "HTTP/1.1", - ProtoMajor: 1, - ProtoMinor: 1, - Header: make(http.Header), - } - - if body != nil { - switch b := body.(type) { - case *bytes.Buffer: - r.Body = ioutil.NopCloser(body) - r.ContentLength = int64(b.Len()) - case *bytes.Reader: - r.Body = ioutil.NopCloser(body) - r.ContentLength = int64(b.Len()) - case *strings.Reader: - r.Body = ioutil.NopCloser(body) - r.ContentLength = int64(b.Len()) - default: - r.Body = ioutil.NopCloser(body) - } - } - - return &r, nil + return http.NewRequest(method, path, body) } diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/esapi.response.go b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/esapi.response.go index dae6785bf..b542aeca8 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/esapi/esapi.response.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/esapi/esapi.response.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package esapi import ( @@ -27,20 +31,32 @@ func (r *Response) String() string { out = new(bytes.Buffer) b1 = bytes.NewBuffer([]byte{}) b2 = bytes.NewBuffer([]byte{}) - tr = io.TeeReader(r.Body, b1) + tr io.Reader ) - defer r.Body.Close() + if r != nil && r.Body != nil { + tr = io.TeeReader(r.Body, b1) + defer r.Body.Close() + + if _, err := io.Copy(b2, tr); err != nil { + out.WriteString(fmt.Sprintf("", err)) + return out.String() + } + defer func() { r.Body = ioutil.NopCloser(b1) }() + } - if _, err := io.Copy(b2, tr); err != nil { - out.WriteString(fmt.Sprintf("", err)) - return out.String() + if r != nil { + out.WriteString(fmt.Sprintf("[%d %s]", r.StatusCode, http.StatusText(r.StatusCode))) + if r.StatusCode > 0 { + out.WriteRune(' ') + } + } else { + out.WriteString("[0 ]") } - defer func() { r.Body = ioutil.NopCloser(b1) }() - out.WriteString(fmt.Sprintf("[%d %s]", r.StatusCode, http.StatusText(r.StatusCode))) - out.WriteRune(' ') - out.ReadFrom(b2) // errcheck exclude (*bytes.Buffer).ReadFrom + if r != nil && r.Body != nil { + out.ReadFrom(b2) // errcheck exclude (*bytes.Buffer).ReadFrom + } return out.String() } @@ -49,9 +65,11 @@ func (r *Response) String() string { // func (r *Response) Status() string { var b strings.Builder - b.WriteString(strconv.Itoa(r.StatusCode)) - b.WriteString(" ") - b.WriteString(http.StatusText(r.StatusCode)) + if r != nil { + b.WriteString(strconv.Itoa(r.StatusCode)) + b.WriteString(" ") + b.WriteString(http.StatusText(r.StatusCode)) + } return b.String() } @@ -60,3 +78,15 @@ func (r *Response) Status() string { func (r *Response) IsError() bool { return r.StatusCode > 299 } + +// Warnings returns the deprecation warnings from response headers. +// +func (r *Response) Warnings() []string { + return r.Header["Warning"] +} + +// HasWarnings returns true when the response headers contain deprecation warnings. +// +func (r *Response) HasWarnings() bool { + return len(r.Warnings()) > 0 +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/estransport/connection.go b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/connection.go new file mode 100644 index 000000000..7764a503b --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/connection.go @@ -0,0 +1,316 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +package estransport + +import ( + "errors" + "fmt" + "math" + "net/url" + "sort" + "sync" + "time" +) + +var ( + defaultResurrectTimeoutInitial = 60 * time.Second + defaultResurrectTimeoutFactorCutoff = 5 +) + +// Selector defines the interface for selecting connections from the pool. +// +type Selector interface { + Select([]*Connection) (*Connection, error) +} + +// ConnectionPool defines the interface for the connection pool. +// +type ConnectionPool interface { + Next() (*Connection, error) // Next returns the next available connection. + OnSuccess(*Connection) error // OnSuccess reports that the connection was successful. + OnFailure(*Connection) error // OnFailure reports that the connection failed. + URLs() []*url.URL // URLs returns the list of URLs of available connections. +} + +// Connection represents a connection to a node. +// +type Connection struct { + sync.Mutex + + URL *url.URL + IsDead bool + DeadSince time.Time + Failures int + + ID string + Name string + Roles []string + Attributes map[string]interface{} +} + +type singleConnectionPool struct { + connection *Connection + + metrics *metrics +} + +type statusConnectionPool struct { + sync.Mutex + + live []*Connection // List of live connections + dead []*Connection // List of dead connections + selector Selector + + metrics *metrics +} + +type roundRobinSelector struct { + sync.Mutex + + curr int // Index of the current connection +} + +// NewConnectionPool creates and returns a default connection pool. +// +func NewConnectionPool(conns []*Connection, selector Selector) (ConnectionPool, error) { + if len(conns) == 1 { + return &singleConnectionPool{connection: conns[0]}, nil + } + if selector == nil { + selector = &roundRobinSelector{curr: -1} + } + return &statusConnectionPool{live: conns, selector: selector}, nil +} + +// Next returns the connection from pool. +// +func (cp *singleConnectionPool) Next() (*Connection, error) { + return cp.connection, nil +} + +// OnSuccess is a no-op for single connection pool. +func (cp *singleConnectionPool) OnSuccess(c *Connection) error { return nil } + +// OnFailure is a no-op for single connection pool. +func (cp *singleConnectionPool) OnFailure(c *Connection) error { return nil } + +// URLs returns the list of URLs of available connections. +func (cp *singleConnectionPool) URLs() []*url.URL { return []*url.URL{cp.connection.URL} } + +func (cp *singleConnectionPool) connections() []*Connection { return []*Connection{cp.connection} } + +// Next returns a connection from pool, or an error. +// +func (cp *statusConnectionPool) Next() (*Connection, error) { + cp.Lock() + defer cp.Unlock() + + // Return next live connection + if len(cp.live) > 0 { + return cp.selector.Select(cp.live) + } else if len(cp.dead) > 0 { + // No live connection is available, resurrect one of the dead ones. + c := cp.dead[len(cp.dead)-1] + cp.dead = cp.dead[:len(cp.dead)-1] + c.Lock() + defer c.Unlock() + cp.resurrect(c, false) + return c, nil + } + return nil, errors.New("no connection available") +} + +// OnSuccess marks the connection as successful. +// +func (cp *statusConnectionPool) OnSuccess(c *Connection) error { + c.Lock() + defer c.Unlock() + + // Short-circuit for live connection + if !c.IsDead { + return nil + } + + c.markAsHealthy() + + cp.Lock() + defer cp.Unlock() + return cp.resurrect(c, true) +} + +// OnFailure marks the connection as failed. +// +func (cp *statusConnectionPool) OnFailure(c *Connection) error { + cp.Lock() + defer cp.Unlock() + + c.Lock() + + if c.IsDead { + if debugLogger != nil { + debugLogger.Logf("Already removed %s\n", c.URL) + } + c.Unlock() + return nil + } + + if debugLogger != nil { + debugLogger.Logf("Removing %s...\n", c.URL) + } + c.markAsDead() + cp.scheduleResurrect(c) + c.Unlock() + + // Push item to dead list and sort slice by number of failures + cp.dead = append(cp.dead, c) + sort.Slice(cp.dead, func(i, j int) bool { + c1 := cp.dead[i] + c2 := cp.dead[j] + c1.Lock() + c2.Lock() + defer c1.Unlock() + defer c2.Unlock() + + res := c1.Failures > c2.Failures + return res + }) + + // Check if connection exists in the list, return error if not. + index := -1 + for i, conn := range cp.live { + if conn == c { + index = i + } + } + if index < 0 { + return errors.New("connection not in live list") + } + + // Remove item; https://github.com/golang/go/wiki/SliceTricks + copy(cp.live[index:], cp.live[index+1:]) + cp.live = cp.live[:len(cp.live)-1] + + return nil +} + +// URLs returns the list of URLs of available connections. +// +func (cp *statusConnectionPool) URLs() []*url.URL { + var urls []*url.URL + + cp.Lock() + defer cp.Unlock() + + for _, c := range cp.live { + urls = append(urls, c.URL) + } + + return urls +} + +func (cp *statusConnectionPool) connections() []*Connection { + var conns []*Connection + conns = append(conns, cp.live...) + conns = append(conns, cp.dead...) + return conns +} + +// resurrect adds the connection to the list of available connections. +// When removeDead is true, it also removes it from the dead list. +// The calling code is responsible for locking. +// +func (cp *statusConnectionPool) resurrect(c *Connection, removeDead bool) error { + if debugLogger != nil { + debugLogger.Logf("Resurrecting %s\n", c.URL) + } + + c.markAsLive() + cp.live = append(cp.live, c) + + if removeDead { + index := -1 + for i, conn := range cp.dead { + if conn == c { + index = i + } + } + if index >= 0 { + // Remove item; https://github.com/golang/go/wiki/SliceTricks + copy(cp.dead[index:], cp.dead[index+1:]) + cp.dead = cp.dead[:len(cp.dead)-1] + } + } + + return nil +} + +// scheduleResurrect schedules the connection to be resurrected. +// +func (cp *statusConnectionPool) scheduleResurrect(c *Connection) { + factor := math.Min(float64(c.Failures-1), float64(defaultResurrectTimeoutFactorCutoff)) + timeout := time.Duration(defaultResurrectTimeoutInitial.Seconds() * math.Exp2(factor) * float64(time.Second)) + if debugLogger != nil { + debugLogger.Logf("Resurrect %s (failures=%d, factor=%1.1f, timeout=%s) in %s\n", c.URL, c.Failures, factor, timeout, c.DeadSince.Add(timeout).Sub(time.Now().UTC()).Truncate(time.Second)) + } + + time.AfterFunc(timeout, func() { + cp.Lock() + defer cp.Unlock() + + c.Lock() + defer c.Unlock() + + if !c.IsDead { + if debugLogger != nil { + debugLogger.Logf("Already resurrected %s\n", c.URL) + } + return + } + + cp.resurrect(c, true) + }) +} + +// Select returns the connection in a round-robin fashion. +// +func (s *roundRobinSelector) Select(conns []*Connection) (*Connection, error) { + s.Lock() + defer s.Unlock() + + s.curr = (s.curr + 1) % len(conns) + return conns[s.curr], nil +} + +// markAsDead marks the connection as dead. +// +func (c *Connection) markAsDead() { + c.IsDead = true + if c.DeadSince.IsZero() { + c.DeadSince = time.Now().UTC() + } + c.Failures++ +} + +// markAsLive marks the connection as alive. +// +func (c *Connection) markAsLive() { + c.IsDead = false +} + +// markAsHealthy marks the connection as healthy. +// +func (c *Connection) markAsHealthy() { + c.IsDead = false + c.DeadSince = time.Time{} + c.Failures = 0 +} + +// String returns a readable connection representation. +// +func (c *Connection) String() string { + c.Lock() + defer c.Unlock() + return fmt.Sprintf("<%s> dead=%v failures=%d", c.URL, c.IsDead, c.Failures) +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/estransport/discovery.go b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/discovery.go new file mode 100644 index 000000000..6acb9eea2 --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/discovery.go @@ -0,0 +1,205 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +package estransport + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "sort" + "strings" + "sync" + "time" +) + +// Discoverable defines the interface for transports supporting node discovery. +// +type Discoverable interface { + DiscoverNodes() error +} + +// nodeInfo represents the information about node in a cluster. +// +// See: https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html +// +type nodeInfo struct { + ID string + Name string + URL *url.URL + Roles []string + Attributes map[string]interface{} + HTTP struct { + PublishAddress string `json:"publish_address"` + } +} + +// DiscoverNodes reloads the client connections by fetching information from the cluster. +// +func (c *Client) DiscoverNodes() error { + var conns []*Connection + + nodes, err := c.getNodesInfo() + if err != nil { + if debugLogger != nil { + debugLogger.Logf("Error getting nodes info: %s\n", err) + } + return fmt.Errorf("discovery: get nodes: %s", err) + } + + for _, node := range nodes { + var ( + isDataNode bool + isIngestNode bool + ) + + roles := append(node.Roles[:0:0], node.Roles...) + sort.Strings(roles) + + if i := sort.SearchStrings(roles, "data"); i < len(roles) && roles[i] == "data" { + isDataNode = true + } + if i := sort.SearchStrings(roles, "ingest"); i < len(roles) && roles[i] == "ingest" { + isIngestNode = true + } + + if debugLogger != nil { + var skip string + if !isDataNode || !isIngestNode { + skip = "; [SKIP]" + } + debugLogger.Logf("Discovered node [%s]; %s; roles=%s%s\n", node.Name, node.URL, node.Roles, skip) + } + + // Skip master only nodes + // TODO(karmi): Move logic to Selector? + if !isDataNode || !isIngestNode { + continue + } + + conns = append(conns, &Connection{ + URL: node.URL, + ID: node.ID, + Name: node.Name, + Roles: node.Roles, + Attributes: node.Attributes, + }) + } + + c.Lock() + defer c.Unlock() + + if lockable, ok := c.pool.(sync.Locker); ok { + lockable.Lock() + defer lockable.Unlock() + } + + if c.poolFunc != nil { + c.pool = c.poolFunc(conns, c.selector) + } else { + // TODO(karmi): Replace only live connections, leave dead scheduled for resurrect? + c.pool, err = NewConnectionPool(conns, c.selector) + if err != nil { + return err + } + } + + return nil +} + +func (c *Client) getNodesInfo() ([]nodeInfo, error) { + var ( + out []nodeInfo + scheme = c.urls[0].Scheme + ) + + req, err := http.NewRequest("GET", "/_nodes/http", nil) + if err != nil { + return out, err + } + + c.Lock() + conn, err := c.pool.Next() + c.Unlock() + // TODO(karmi): If no connection is returned, fallback to original URLs + if err != nil { + return out, err + } + + c.setReqURL(conn.URL, req) + c.setReqAuth(conn.URL, req) + c.setReqUserAgent(req) + + res, err := c.transport.RoundTrip(req) + if err != nil { + return out, err + } + defer res.Body.Close() + + if res.StatusCode > 200 { + body, _ := ioutil.ReadAll(res.Body) + return out, fmt.Errorf("server error: %s: %s", res.Status, body) + } + + var env map[string]json.RawMessage + if err := json.NewDecoder(res.Body).Decode(&env); err != nil { + return out, err + } + + var nodes map[string]nodeInfo + if err := json.Unmarshal(env["nodes"], &nodes); err != nil { + return out, err + } + + for id, node := range nodes { + node.ID = id + u, err := c.getNodeURL(node, scheme) + if err != nil { + return out, err + } + node.URL = u + out = append(out, node) + } + + return out, nil +} + +func (c *Client) getNodeURL(node nodeInfo, scheme string) (*url.URL, error) { + var ( + host string + port string + + addrs = strings.Split(node.HTTP.PublishAddress, "/") + ports = strings.Split(node.HTTP.PublishAddress, ":") + ) + + if len(addrs) > 1 { + host = addrs[0] + } else { + host = strings.Split(addrs[0], ":")[0] + } + port = ports[len(ports)-1] + + u := &url.URL{ + Scheme: scheme, + Host: host + ":" + port, + } + + return u, nil +} + +func (c *Client) scheduleDiscoverNodes(d time.Duration) { + go c.DiscoverNodes() + + c.Lock() + defer c.Unlock() + if c.discoverNodesTimer != nil { + c.discoverNodesTimer.Stop() + } + c.discoverNodesTimer = time.AfterFunc(c.discoverNodesInterval, func() { + c.scheduleDiscoverNodes(c.discoverNodesInterval) + }) +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/estransport/doc.go b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/doc.go index aa3eba3f9..096b73070 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/estransport/doc.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/doc.go @@ -4,14 +4,31 @@ Package estransport provides the transport layer for the Elasticsearch client. It is automatically included in the client provided by the github.com/elastic/go-elasticsearch package and is not intended for direct use: to configure the client, use the elasticsearch.Config struct. -The default HTTP transport of the client is http.Transport. +The default HTTP transport of the client is http.Transport; use the Transport option to customize it; +see the _examples/coniguration.go and _examples/customization.go files in this repository for information. -The package defines the "Selector" interface for getting a URL from the list. At the moment, -the implementation is rather minimal: the client takes a slice of url.URL pointers, -and round-robins across them when performing the request. +The package will automatically retry requests on network-related errors, and on specific +response status codes (by default 502, 503, 504). Use the RetryOnStatus option to customize the list. +The transport will not retry a timeout network error, unless enabled by setting EnableRetryOnTimeout to true. -The package defines the "Logger" interface for logging information about request and response. +Use the MaxRetries option to configure the number of retries, and set DisableRetry to true +to disable the retry behaviour altogether. + +By default, the retry will be performed without any delay; to configure a backoff interval, +implement the RetryBackoff option function; see an example in the package unit tests for information. + +When multiple addresses are passed in configuration, the package will use them in a round-robin fashion, +and will keep track of live and dead nodes. The status of dead nodes is checked periodically. + +To customize the node selection behaviour, provide a Selector implementation in the configuration. +To replace the connection pool entirely, provide a custom ConnectionPool implementation via +the ConnectionPoolFunc option. + +The package defines the Logger interface for logging information about request and response. It comes with several bundled loggers for logging in text and JSON. +Use the EnableDebugLogger option to enable the debugging logger for connection management. + +Use the EnableMetrics option to enable metric collection and export. */ package estransport diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/estransport/estransport.go b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/estransport.go index 48c89ebd1..c69cb3afb 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/estransport/estransport.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/estransport.go @@ -1,14 +1,24 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package estransport import ( "bytes" + "crypto/x509" + "errors" "fmt" + "io" "io/ioutil" + "net" "net/http" "net/url" + "os" "regexp" "runtime" "strings" + "sync" "time" "github.com/elastic/go-elasticsearch/v6/internal/version" @@ -21,6 +31,9 @@ const Version = version.Client var ( userAgent string reGoVersion = regexp.MustCompile(`go(\d+\.\d+\..+)`) + + defaultMaxRetries = 3 + defaultRetryOnStatus = [...]int{502, 503, 504} ) func init() { @@ -39,90 +52,275 @@ type Config struct { URLs []*url.URL Username string Password string + APIKey string + + Header http.Header + CACert []byte + + RetryOnStatus []int + DisableRetry bool + EnableRetryOnTimeout bool + MaxRetries int + RetryBackoff func(attempt int) time.Duration + + EnableMetrics bool + EnableDebugLogger bool + + DiscoverNodesInterval time.Duration Transport http.RoundTripper Logger Logger + Selector Selector + + ConnectionPoolFunc func([]*Connection, Selector) ConnectionPool } // Client represents the HTTP client. // type Client struct { + sync.Mutex + urls []*url.URL username string password string + apikey string + header http.Header + + retryOnStatus []int + disableRetry bool + enableRetryOnTimeout bool + maxRetries int + retryBackoff func(attempt int) time.Duration + discoverNodesInterval time.Duration + discoverNodesTimer *time.Timer + + metrics *metrics transport http.RoundTripper - selector Selector logger Logger + selector Selector + pool ConnectionPool + poolFunc func([]*Connection, Selector) ConnectionPool } -// New creates new HTTP client. +// New creates new transport client. // // http.DefaultTransport will be used if no transport is passed in the configuration. // -func New(cfg Config) *Client { +func New(cfg Config) (*Client, error) { if cfg.Transport == nil { cfg.Transport = http.DefaultTransport } - return &Client{ + if cfg.CACert != nil { + httpTransport, ok := cfg.Transport.(*http.Transport) + if !ok { + return nil, fmt.Errorf("unable to set CA certificate for transport of type %T", cfg.Transport) + } + + httpTransport = httpTransport.Clone() + httpTransport.TLSClientConfig.RootCAs = x509.NewCertPool() + + if ok := httpTransport.TLSClientConfig.RootCAs.AppendCertsFromPEM(cfg.CACert); !ok { + return nil, errors.New("unable to add CA certificate") + } + + cfg.Transport = httpTransport + } + + if len(cfg.RetryOnStatus) == 0 { + cfg.RetryOnStatus = defaultRetryOnStatus[:] + } + + if cfg.MaxRetries == 0 { + cfg.MaxRetries = defaultMaxRetries + } + + var conns []*Connection + for _, u := range cfg.URLs { + conns = append(conns, &Connection{URL: u}) + } + + client := Client{ urls: cfg.URLs, username: cfg.Username, password: cfg.Password, + apikey: cfg.APIKey, + header: cfg.Header, + + retryOnStatus: cfg.RetryOnStatus, + disableRetry: cfg.DisableRetry, + enableRetryOnTimeout: cfg.EnableRetryOnTimeout, + maxRetries: cfg.MaxRetries, + retryBackoff: cfg.RetryBackoff, + discoverNodesInterval: cfg.DiscoverNodesInterval, transport: cfg.Transport, - selector: NewRoundRobinSelector(cfg.URLs...), logger: cfg.Logger, + selector: cfg.Selector, + poolFunc: cfg.ConnectionPoolFunc, } + + if client.poolFunc != nil { + client.pool = client.poolFunc(conns, client.selector) + } else { + client.pool, _ = NewConnectionPool(conns, client.selector) + } + + if cfg.EnableDebugLogger { + debugLogger = &debuggingLogger{Output: os.Stdout} + } + + if cfg.EnableMetrics { + client.metrics = &metrics{responses: make(map[int]int)} + // TODO(karmi): Type assertion to interface + if pool, ok := client.pool.(*singleConnectionPool); ok { + pool.metrics = client.metrics + } + if pool, ok := client.pool.(*statusConnectionPool); ok { + pool.metrics = client.metrics + } + } + + if client.discoverNodesInterval > 0 { + time.AfterFunc(client.discoverNodesInterval, func() { + client.scheduleDiscoverNodes(client.discoverNodesInterval) + }) + } + + return &client, nil } // Perform executes the request and returns a response or error. // func (c *Client) Perform(req *http.Request) (*http.Response, error) { - u, err := c.getURL() - if err != nil { - // TODO(karmi): Log error - return nil, fmt.Errorf("cannot get URL: %s", err) + var ( + res *http.Response + err error + ) + + // Record metrics, when enabled + if c.metrics != nil { + c.metrics.Lock() + c.metrics.requests++ + c.metrics.Unlock() } - c.setURL(u, req) - c.setUserAgent(req) - - if _, ok := req.Header["Authorization"]; !ok { - c.setBasicAuth(u, req) + // Update request + c.setReqUserAgent(req) + c.setReqGlobalHeader(req) + + if req.Body != nil && req.Body != http.NoBody && req.GetBody == nil { + if !c.disableRetry || (c.logger != nil && c.logger.RequestBodyEnabled()) { + var buf bytes.Buffer + buf.ReadFrom(req.Body) + req.GetBody = func() (io.ReadCloser, error) { + r := buf + return ioutil.NopCloser(&r), nil + } + if req.Body, err = req.GetBody(); err != nil { + return nil, fmt.Errorf("cannot get request body: %s", err) + } + } } - var dupReqBody *bytes.Buffer - if c.logger != nil && c.logger.RequestBodyEnabled() { - if req.Body != nil && req.Body != http.NoBody { - dupReqBody = bytes.NewBuffer(make([]byte, 0, int(req.ContentLength))) - dupReqBody.ReadFrom(req.Body) - req.Body = ioutil.NopCloser(bytes.NewBuffer(dupReqBody.Bytes())) + for i := 1; i <= c.maxRetries; i++ { + var ( + conn *Connection + shouldRetry bool + ) + + // Get connection from the pool + c.Lock() + conn, err = c.pool.Next() + c.Unlock() + if err != nil { + if c.logger != nil { + c.logRoundTrip(req, nil, err, time.Time{}, time.Duration(0)) + } + return nil, fmt.Errorf("cannot get connection: %s", err) } - } - start := time.Now().UTC() - res, err := c.transport.RoundTrip(req) - dur := time.Since(start) + // Update request + c.setReqURL(conn.URL, req) + c.setReqAuth(conn.URL, req) - if c.logger != nil { - var dupRes http.Response - if res != nil { - dupRes = *res + if !c.disableRetry && i > 1 && req.Body != nil && req.Body != http.NoBody { + body, err := req.GetBody() + if err != nil { + return nil, fmt.Errorf("cannot get request body: %s", err) + } + req.Body = body } - if c.logger.RequestBodyEnabled() { - if req.Body != nil && req.Body != http.NoBody { - req.Body = ioutil.NopCloser(dupReqBody) + + // Set up time measures and execute the request + start := time.Now().UTC() + res, err = c.transport.RoundTrip(req) + dur := time.Since(start) + + // Log request and response + if c.logger != nil { + if c.logger.RequestBodyEnabled() && req.Body != nil && req.Body != http.NoBody { + req.Body, _ = req.GetBody() } + c.logRoundTrip(req, res, err, start, dur) } - if c.logger.ResponseBodyEnabled() { - if res != nil && res.Body != nil && res.Body != http.NoBody { - b1, b2, _ := duplicateBody(res.Body) - dupRes.Body = b1 - res.Body = b2 + + if err != nil { + // Record metrics, when enabled + if c.metrics != nil { + c.metrics.Lock() + c.metrics.failures++ + c.metrics.Unlock() } + + // Report the connection as unsuccessful + c.Lock() + c.pool.OnFailure(conn) + c.Unlock() + + // Retry on EOF errors + if err == io.EOF { + shouldRetry = true + } + + // Retry on network errors, but not on timeout errors, unless configured + if err, ok := err.(net.Error); ok { + if (!err.Timeout() || c.enableRetryOnTimeout) && !c.disableRetry { + shouldRetry = true + } + } + } else { + // Report the connection as succesfull + c.Lock() + c.pool.OnSuccess(conn) + c.Unlock() + } + + if res != nil && c.metrics != nil { + c.metrics.Lock() + c.metrics.responses[res.StatusCode]++ + c.metrics.Unlock() + } + + // Retry on configured response statuses + if res != nil && !c.disableRetry { + for _, code := range c.retryOnStatus { + if res.StatusCode == code { + shouldRetry = true + } + } + } + + // Break if retry should not be performed + if !shouldRetry { + break + } + + // Delay the retry if a backoff function is configured + if c.retryBackoff != nil { + time.Sleep(c.retryBackoff(i)) } - c.logger.LogRoundTrip(req, &dupRes, err, start, dur) // errcheck exclude } // TODO(karmi): Wrap error @@ -131,15 +329,12 @@ func (c *Client) Perform(req *http.Request) (*http.Response, error) { // URLs returns a list of transport URLs. // +// func (c *Client) URLs() []*url.URL { - return c.urls -} - -func (c *Client) getURL() (*url.URL, error) { - return c.selector.Select() + return c.pool.URLs() } -func (c *Client) setURL(u *url.URL, req *http.Request) *http.Request { +func (c *Client) setReqURL(u *url.URL, req *http.Request) *http.Request { req.URL.Scheme = u.Scheme req.URL.Host = u.Host @@ -154,26 +349,71 @@ func (c *Client) setURL(u *url.URL, req *http.Request) *http.Request { return req } -func (c *Client) setBasicAuth(u *url.URL, req *http.Request) *http.Request { - if u.User != nil { - password, _ := u.User.Password() - req.SetBasicAuth(u.User.Username(), password) - return req - } +func (c *Client) setReqAuth(u *url.URL, req *http.Request) *http.Request { + if _, ok := req.Header["Authorization"]; !ok { + if u.User != nil { + password, _ := u.User.Password() + req.SetBasicAuth(u.User.Username(), password) + return req + } + + if c.apikey != "" { + var b bytes.Buffer + b.Grow(len("APIKey ") + len(c.apikey)) + b.WriteString("APIKey ") + b.WriteString(c.apikey) + req.Header.Set("Authorization", b.String()) + return req + } - if c.username != "" && c.password != "" { - req.SetBasicAuth(c.username, c.password) - return req + if c.username != "" && c.password != "" { + req.SetBasicAuth(c.username, c.password) + return req + } } return req } -func (c *Client) setUserAgent(req *http.Request) *http.Request { +func (c *Client) setReqUserAgent(req *http.Request) *http.Request { req.Header.Set("User-Agent", userAgent) return req } +func (c *Client) setReqGlobalHeader(req *http.Request) *http.Request { + if len(c.header) > 0 { + for k, v := range c.header { + if req.Header.Get(k) != k { + for _, vv := range v { + req.Header.Add(k, vv) + } + } + } + } + return req +} + +func (c *Client) logRoundTrip( + req *http.Request, + res *http.Response, + err error, + start time.Time, + dur time.Duration, +) { + var dupRes http.Response + if res != nil { + dupRes = *res + } + if c.logger.ResponseBodyEnabled() { + if res != nil && res.Body != nil && res.Body != http.NoBody { + b1, b2, _ := duplicateBody(res.Body) + dupRes.Body = b1 + res.Body = b2 + } + } + c.logger.LogRoundTrip(req, &dupRes, err, start, dur) // errcheck exclude +} + func initUserAgent() string { var b strings.Builder diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/estransport/logger.go b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/logger.go index 55d35e9a3..4f0af98a3 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/estransport/logger.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/logger.go @@ -1,3 +1,7 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package estransport import ( @@ -14,6 +18,8 @@ import ( "time" ) +var debugLogger DebuggingLogger + // Logger defines an interface for logging request and response. // type Logger interface { @@ -26,6 +32,13 @@ type Logger interface { ResponseBodyEnabled() bool } +// DebuggingLogger defines the interface for a debugging logger. +// +type DebuggingLogger interface { + Log(a ...interface{}) error + Logf(format string, a ...interface{}) error +} + // TextLogger prints the log message in plain text. // type TextLogger struct { @@ -58,6 +71,12 @@ type JSONLogger struct { EnableResponseBody bool } +// debuggingLogger prints debug messages as plain text. +// +type debuggingLogger struct { + Output io.Writer +} + // LogRoundTrip prints the information about request and response. // func (l *TextLogger) LogRoundTrip(req *http.Request, res *http.Response, err error, start time.Time, dur time.Duration) error { @@ -70,7 +89,12 @@ func (l *TextLogger) LogRoundTrip(req *http.Request, res *http.Response, err err ) if l.RequestBodyEnabled() && req != nil && req.Body != nil && req.Body != http.NoBody { var buf bytes.Buffer - buf.ReadFrom(req.Body) + if req.GetBody != nil { + b, _ := req.GetBody() + buf.ReadFrom(b) + } else { + buf.ReadFrom(req.Body) + } logBodyAsText(l.Output, &buf, ">") } if l.ResponseBodyEnabled() && res != nil && res.Body != nil && res.Body != http.NoBody { @@ -130,7 +154,12 @@ func (l *ColorLogger) LogRoundTrip(req *http.Request, res *http.Response, err er if l.RequestBodyEnabled() && req != nil && req.Body != nil && req.Body != http.NoBody { var buf bytes.Buffer - buf.ReadFrom(req.Body) + if req.GetBody != nil { + b, _ := req.GetBody() + buf.ReadFrom(b) + } else { + buf.ReadFrom(req.Body) + } fmt.Fprint(l.Output, "\x1b[2m") logBodyAsText(l.Output, &buf, " »") fmt.Fprint(l.Output, "\x1b[0m") @@ -207,7 +236,12 @@ func (l *CurlLogger) LogRoundTrip(req *http.Request, res *http.Response, err err if req != nil && req.Body != nil && req.Body != http.NoBody { var buf bytes.Buffer - buf.ReadFrom(req.Body) + if req.GetBody != nil { + b, _ := req.GetBody() + buf.ReadFrom(b) + } else { + buf.ReadFrom(req.Body) + } b.Grow(buf.Len()) b.WriteString(" -d \\\n'") @@ -310,7 +344,12 @@ func (l *JSONLogger) LogRoundTrip(req *http.Request, res *http.Response, err err appendQuote(req.Method) if l.RequestBodyEnabled() && req != nil && req.Body != nil && req.Body != http.NoBody { var buf bytes.Buffer - buf.ReadFrom(req.Body) + if req.GetBody != nil { + b, _ := req.GetBody() + buf.ReadFrom(b) + } else { + buf.ReadFrom(req.Body) + } b.Grow(buf.Len() + 8) b.WriteString(`,"body":`) @@ -351,6 +390,20 @@ func (l *JSONLogger) RequestBodyEnabled() bool { return l.EnableRequestBody } // ResponseBodyEnabled returns true when the response body should be logged. func (l *JSONLogger) ResponseBodyEnabled() bool { return l.EnableResponseBody } +// Log prints the arguments to output in default format. +// +func (l *debuggingLogger) Log(a ...interface{}) error { + _, err := fmt.Fprint(l.Output, a...) + return err +} + +// Logf prints formats the arguments and prints them to output. +// +func (l *debuggingLogger) Logf(format string, a ...interface{}) error { + _, err := fmt.Fprintf(l.Output, format, a...) + return err +} + func logBodyAsText(dst io.Writer, body io.Reader, prefix string) { scanner := bufio.NewScanner(body) for scanner.Scan() { diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/estransport/metrics.go b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/metrics.go new file mode 100644 index 000000000..c01df0a2c --- /dev/null +++ b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/metrics.go @@ -0,0 +1,181 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + +package estransport + +import ( + "errors" + "fmt" + "strconv" + "strings" + "sync" + "time" +) + +// Measurable defines the interface for transports supporting metrics. +// +type Measurable interface { + Metrics() (Metrics, error) +} + +// connectionable defines the interface for transports returning a list of connections. +// +type connectionable interface { + connections() []*Connection +} + +// Metrics represents the transport metrics. +// +type Metrics struct { + Requests int `json:"requests"` + Failures int `json:"failures"` + Responses map[int]int `json:"responses"` + + Connections []fmt.Stringer `json:"connections"` +} + +// ConnectionMetric represents metric information for a connection. +// +type ConnectionMetric struct { + URL string `json:"url"` + Failures int `json:"failures,omitempty"` + IsDead bool `json:"dead,omitempty"` + DeadSince *time.Time `json:"dead_since,omitempty"` + + Meta struct { + ID string `json:"id"` + Name string `json:"name"` + Roles []string `json:"roles"` + } `json:"meta"` +} + +// metrics represents the inner state of metrics. +// +type metrics struct { + sync.RWMutex + + requests int + failures int + responses map[int]int + + connections []*Connection +} + +// Metrics returns the transport metrics. +// +func (c *Client) Metrics() (Metrics, error) { + if c.metrics == nil { + return Metrics{}, errors.New("transport metrics not enabled") + } + c.metrics.RLock() + defer c.metrics.RUnlock() + + if lockable, ok := c.pool.(sync.Locker); ok { + lockable.Lock() + defer lockable.Unlock() + } + + m := Metrics{ + Requests: c.metrics.requests, + Failures: c.metrics.failures, + Responses: c.metrics.responses, + } + + if pool, ok := c.pool.(connectionable); ok { + for _, c := range pool.connections() { + c.Lock() + + cm := ConnectionMetric{ + URL: c.URL.String(), + IsDead: c.IsDead, + Failures: c.Failures, + } + + if !c.DeadSince.IsZero() { + cm.DeadSince = &c.DeadSince + } + + if c.ID != "" { + cm.Meta.ID = c.ID + } + + if c.Name != "" { + cm.Meta.Name = c.Name + } + + if len(c.Roles) > 0 { + cm.Meta.Roles = c.Roles + } + + m.Connections = append(m.Connections, cm) + c.Unlock() + } + } + + return m, nil +} + +// String returns the metrics as a string. +// +func (m Metrics) String() string { + var ( + i int + b strings.Builder + ) + b.WriteString("{") + + b.WriteString("Requests:") + b.WriteString(strconv.Itoa(m.Requests)) + + b.WriteString(" Failures:") + b.WriteString(strconv.Itoa(m.Failures)) + + if len(m.Responses) > 0 { + b.WriteString(" Responses: ") + b.WriteString("[") + + for code, num := range m.Responses { + b.WriteString(strconv.Itoa(code)) + b.WriteString(":") + b.WriteString(strconv.Itoa(num)) + if i+1 < len(m.Responses) { + b.WriteString(", ") + } + i++ + } + b.WriteString("]") + } + + b.WriteString(" Connections: [") + for i, c := range m.Connections { + b.WriteString(c.String()) + if i+1 < len(m.Connections) { + b.WriteString(", ") + } + i++ + } + b.WriteString("]") + + b.WriteString("}") + return b.String() +} + +// String returns the connection information as a string. +// +func (cm ConnectionMetric) String() string { + var b strings.Builder + b.WriteString("{") + b.WriteString(cm.URL) + if cm.IsDead { + fmt.Fprintf(&b, " dead=%v", cm.IsDead) + } + if cm.Failures > 0 { + fmt.Fprintf(&b, " failures=%d", cm.Failures) + } + if cm.DeadSince != nil { + fmt.Fprintf(&b, " dead_since=%s", cm.DeadSince.Local().Format(time.Stamp)) + } + b.WriteString("}") + return b.String() +} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/estransport/selector.go b/vendor/github.com/elastic/go-elasticsearch/v6/estransport/selector.go deleted file mode 100644 index 45de0deb5..000000000 --- a/vendor/github.com/elastic/go-elasticsearch/v6/estransport/selector.go +++ /dev/null @@ -1,54 +0,0 @@ -package estransport - -import ( - "container/ring" - "errors" - "net/url" - "sync" -) - -// Selector defines the interface for selecting URLs for performing request. -// -type Selector interface { - Select() (*url.URL, error) -} - -// RoundRobinSelector implements a round-robin selection strategy. -// -type RoundRobinSelector struct { - sync.Mutex - ring *ring.Ring -} - -// Select returns a URL or error from the list of URLs in a round-robin fashion. -// -func (r *RoundRobinSelector) Select() (*url.URL, error) { - r.Lock() - defer r.Unlock() - - if r.ring.Len() < 1 { - return nil, errors.New("No URL available") - } - - v := r.ring.Value - if ov, ok := v.(*url.URL); !ok || ov == nil { - return nil, errors.New("No URL available") - } - - r.ring = r.ring.Next() - return v.(*url.URL), nil -} - -// NewRoundRobinSelector creates a new RoundRobinSelector. -// -func NewRoundRobinSelector(urls ...*url.URL) *RoundRobinSelector { - r := RoundRobinSelector{} - - r.ring = ring.New(len(urls)) - for _, u := range urls { - r.ring.Value = u - r.ring = r.ring.Next() - } - - return &r -} diff --git a/vendor/github.com/elastic/go-elasticsearch/v6/internal/version/version.go b/vendor/github.com/elastic/go-elasticsearch/v6/internal/version/version.go index 225d92a78..0b18c4b76 100644 --- a/vendor/github.com/elastic/go-elasticsearch/v6/internal/version/version.go +++ b/vendor/github.com/elastic/go-elasticsearch/v6/internal/version/version.go @@ -1,5 +1,9 @@ +// Licensed to Elasticsearch B.V. under one or more agreements. +// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + package version // Client returns the client version as a string. // -const Client = "6.8.2" +const Client = "6.8.10" diff --git a/vendor/modules.txt b/vendor/modules.txt index a6f0f2291..8e4fd32be 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -296,7 +296,7 @@ github.com/docker/go-units # github.com/dustin/go-humanize v1.0.0 ## explicit github.com/dustin/go-humanize -# github.com/elastic/go-elasticsearch/v6 v6.8.2 +# github.com/elastic/go-elasticsearch/v6 v6.8.10 ## explicit; go 1.11 github.com/elastic/go-elasticsearch/v6 github.com/elastic/go-elasticsearch/v6/esapi